blessed-components - v1.20.0
    Preparing search index...

    Interface SpotlightData<TItem>

    Stateful data accepted by spotlight.

    interface SpotlightData<TItem extends SpotlightItem = SpotlightItem> {
        capabilities?: Pick<TerminalCapabilities, "colorLevel">;
        backgroundTone?: keyof ThemeColors;
        borderTone?: keyof ThemeColors;
        foregroundTone?: keyof ThemeColors;
        closeOnAction?: boolean;
        dismissOnEscape?: boolean;
        emptyText?: string;
        id: string;
        items: readonly TItem[];
        label?: string;
        limit?: number;
        modal?: boolean;
        onAction?: (item: TItem) => void;
        placeholder?: string;
        theme?: Theme;
        defaultOpen?: boolean;
        defaultQuery?: string;
        onOpenChange?: (open: boolean) => void;
        onQueryChange?: (query: string) => void;
        open?: boolean;
        query?: string;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    capabilities?: Pick<TerminalCapabilities, "colorLevel">

    Explicit color capability used for deterministic rendering.

    backgroundTone?: keyof ThemeColors

    Semantic background token.

    'background'

    borderTone?: keyof ThemeColors

    Semantic border token.

    'border'

    foregroundTone?: keyof ThemeColors

    Semantic foreground token.

    'foreground'

    closeOnAction?: boolean

    Whether choosing an action requests closing.

    true

    dismissOnEscape?: boolean

    Whether Escape requests closing.

    true

    emptyText?: string

    Text displayed when no results match.

    id: string

    Stable overlay identifier.

    items: readonly TItem[]

    Ordered actions/resources. Disabled items are visible but not interactive.

    label?: string

    Field label.

    'Search'

    limit?: number

    Maximum returned results before viewport clipping.

    modal?: boolean

    Whether this Spotlight blocks lower overlay layers.

    true

    onAction?: (item: TItem) => void

    Called when Enter, Space, click, or SpotlightHandle.activateActive chooses a result.

    placeholder?: string

    Placeholder shown when query is empty.

    theme?: Theme

    Semantic terminal theme.

    defaultOpen?: boolean

    Initial state for uncontrolled usage.

    false

    defaultQuery?: string

    Initial query for uncontrolled usage.

    ''

    onOpenChange?: (open: boolean) => void

    Called when Spotlight requests an open-state change.

    onQueryChange?: (query: string) => void

    Called when Spotlight query changes.

    open?: boolean

    Controlled open state.

    query?: string

    Controlled query text.