Pilates
    Preparing search index...

    Interface MultiSelectProps<T>

    interface MultiSelectProps<T> {
        autoFocus?: boolean;
        focus?: boolean;
        focusId?: string;
        indicator?: (props: MultiSelectIndicatorProps) => ReactNode;
        initialIndex?: number;
        items: SelectItem<T>[];
        onChange: (next: Set<string>) => void;
        onHighlight?: (item: SelectItem<T>) => void;
        onSubmit?: (selected: SelectItem<T>[]) => void;
        selectedKeys: ReadonlySet<string>;
    }

    Type Parameters

    • T
    Index

    Properties

    autoFocus?: boolean

    When focusId is set, take focus on mount if no other focusable currently holds it.

    focus?: boolean

    Default true. Ignored when focusId is set — focus state then comes from the useFocus registration instead.

    focusId?: string

    Register this MultiSelect with useFocus(id) so the surrounding <FocusProvider> can route Tab / Shift+Tab cycling through it.

    indicator?: (props: MultiSelectIndicatorProps) => ReactNode

    Custom marker rendered to the left of each row's label.

    initialIndex?: number

    Default 0; clamped forward to first non-disabled item.

    items: SelectItem<T>[]
    onChange: (next: Set<string>) => void

    Called when the user toggles an item via Space. Receives a NEW Set containing the resulting selection.

    onHighlight?: (item: SelectItem<T>) => void

    Fires whenever the highlight cursor moves (skips initial mount).

    onSubmit?: (selected: SelectItem<T>[]) => void

    Called when the user presses Enter. Receives the items currently in selectedKeys, ordered to match items.

    selectedKeys: ReadonlySet<string>

    Currently-selected items, keyed by item.key ?? String(item.value). Controlled — onChange produces the next Set.