@antadesign/anta
    Preparing search index...

    Type Alias SelectProps<V>Unreviewed

    SelectProps: SelectCommonProps<V> & (
        | {
            selection?: "single";
            value?: V;
            defaultValue?: V;
            onValueChange?: (value: V, attrs: SelectChangeAttrs<V>) => void;
        }
        | {
            selection: "multiple";
            value?: V[];
            defaultValue?: V[];
            onValueChange?: (value: V[], attrs: SelectChangeAttrs<V>) => void;
        }
    )

    <Select> props. selection discriminates the value shape: single mode (value: string) or multiple (value: string[]).

    Type Parameters

    Type Declaration

    • {
          selection?: "single";
          value?: V;
          defaultValue?: V;
          onValueChange?: (value: V, attrs: SelectChangeAttrs<V>) => void;
      }
      • Optional Unreviewedselection?: "single"

        Selection mode. 'single' (the default) keeps value a single value and closes the menu on pick. Switch to 'multiple' for checkboxes + an array value.

        single
        
      • Optional Unreviewedvalue?: V

        Controlled value: the selected option's value. Update it through onValueChange. Leave it undefined for uncontrolled use.

      • Optional UnrevieweddefaultValue?: V

        Initial selected option value for uncontrolled use.

      • Optional UnreviewedonValueChange?: (value: V, attrs: SelectChangeAttrs<V>) => void

        Fires after the selection changes, with the new value and a { value, option } snapshot. Select has no discrete element state, so there is no cancelable onStateChange (see the Input event-model note).

    • {
          selection: "multiple";
          value?: V[];
          defaultValue?: V[];
          onValueChange?: (value: V[], attrs: SelectChangeAttrs<V>) => void;
      }
      • Unreviewedselection: "multiple"

        Multi-select: checkboxes on every row, the menu stays open while toggling, the field shows an "N selected" count, and value is an array.

      • Optional Unreviewedvalue?: V[]

        Controlled values — the values of the selected options (see the single-select value note).

      • Optional UnrevieweddefaultValue?: V[]

        Initial values (option values) for the uncontrolled case.

      • Optional UnreviewedonValueChange?: (value: V[], attrs: SelectChangeAttrs<V>) => void

        Fires after any toggle, with the new value array and a { value, option, selected } snapshot of the row that changed (or { all: true } for the Select-all row).