@@ -60,7 +60,7 @@ const [value, setValue] = useState('apple');
6060
6161### Multiple
6262
63- ` multiple ` makes the value a ` string[] ` . Picking an option adds or removes it and keeps the
63+ ` multiple ` makes the value an array . Picking an option adds or removes it and keeps the
6464popup open. ` Select.Value ` shows the selected labels joined with commas; pass a function as
6565its children to render the selection yourself.
6666
@@ -104,36 +104,36 @@ props. `Select.Portal` is optional.
104104
105105### ` Select.Root `
106106
107- | Prop | Type | Default | Description |
108- | --------------------------------- | ------------------------------------ | --------------------------- | ------------------------------------------------------------------ |
109- | <code >multiple</code > | <code >boolean</code > | <code >false</code > | Allow selecting several options |
110- | <code >value</code > | <code >string \| string [ ] </code > | — | Controlled selected value; an array when ` multiple ` |
111- | <code >defaultValue</code > | <code >string \| string [ ] </code > | — | Initial selected value (uncontrolled); an array when ` multiple ` |
112- | <code >onValueChange</code > | <code >(value) => void</code > | — | Called with the new value when the selection changes |
113- | <code >open</code > | <code >boolean</code > | — | Controlled open state |
114- | <code >defaultOpen</code > | <code >boolean</code > | <code >false</code > | Initial open state (uncontrolled) |
115- | <code >onOpenChange</code > | <code >(open: boolean) => void</code > | — | Called when the open state changes |
116- | <code >items</code > | <code >SelectItem[ ] </code > | — | ` { label, value }[] ` used to resolve the selected label early |
117- | <code >alignItemWithTrigger</code > | <code >boolean</code > | <code >true</code > | Overlay the selected item on the trigger (native-` <select> ` style) |
118- | <code >placement</code > | <code >Placement</code > | <code >'bottom-start'</code > | Placement when not aligning to the item |
119- | <code >sideOffset</code > | <code >number</code > | <code >4</code > | Gap in px (applies only when ` alignItemWithTrigger={false} ` ) |
120-
121- ` SelectItem ` is ` { label: string; value: string } ` — disabling is done per-` Option ` .
107+ | Prop | Type | Default | Description |
108+ | --------------------------------- | ------------------------------------- | --------------------------- | -- ------------------------------------------------------------------ |
109+ | <code >multiple</code > | <code >boolean</code > | <code >false</code > | Allow selecting several options |
110+ | <code >value</code > | <code >Value \| null \| Value [ ] </code > | — | Controlled selected value; ` null ` for none, an array when ` multiple ` |
111+ | <code >defaultValue</code > | <code >Value \| null \| Value [ ] </code > | — | Initial selected value (uncontrolled); an array when ` multiple ` |
112+ | <code >onValueChange</code > | <code >(value) => void</code > | — | Called with the new value when the selection changes |
113+ | <code >open</code > | <code >boolean</code > | — | Controlled open state |
114+ | <code >defaultOpen</code > | <code >boolean</code > | <code >false</code > | Initial open state (uncontrolled) |
115+ | <code >onOpenChange</code > | <code >(open: boolean) => void</code > | — | Called when the open state changes |
116+ | <code >items</code > | <code >SelectItem[ ] </code > | — | ` { label, value }[] ` used to resolve the selected label early |
117+ | <code >alignItemWithTrigger</code > | <code >boolean</code > | <code >true</code > | Overlay the selected item on the trigger (native-` <select> ` style) |
118+ | <code >placement</code > | <code >Placement</code > | <code >'bottom-start'</code > | Placement when not aligning to the item |
119+ | <code >sideOffset</code > | <code >number</code > | <code >4</code > | Gap in px (applies only when ` alignItemWithTrigger={false} ` ) |
120+
121+ ` SelectItem ` is ` { label: string; value: Value } ` — disabling is done per-` Option ` .
122122
123123### ` Select.Value `
124124
125- | Prop | Type | Default | Description |
126- | ------------------------ | ---------------------------------------------------------- | ------- | --------------------------------------------------------------------- |
127- | <code >placeholder</code > | <code >ReactNode</code > | — | Rendered when no value is selected |
128- | <code >children</code > | <code >ReactNode \| ((value: string [ ] ) => ReactNode)</code > | — | Replaces the selected labels; a function receives the selected values |
125+ | Prop | Type | Default | Description |
126+ | ------------------------ | ----------------------------------------------------------- | ------- | --------------------------------------------------------------------- |
127+ | <code >placeholder</code > | <code >ReactNode</code > | — | Rendered when no value is selected |
128+ | <code >children</code > | <code >ReactNode \| ((value: unknown [ ] ) => ReactNode)</code > | — | Replaces the selected labels; a function receives the selected values |
129129
130130### ` Select.Option `
131131
132- | Prop | Type | Default | Description |
133- | --------------------- | -------------------- | --------------------- | -------------------------------------------- |
134- | <code >value</code > | <code >string </code > | — (required) | The option's value |
135- | <code >label</code > | <code >string</code > | falls back to ` value ` | Display label, also used for typeahead |
136- | <code >disabled</code > | <code >boolean</code > | — | Prevent selection (stays keyboard-focusable) |
132+ | Prop | Type | Default | Description |
133+ | --------------------- | -------------------- | --------------------- | --------------------------------------------- |
134+ | <code >value</code > | <code >unknown </code > | — (required) | The option's value, compared with ` Object.is ` |
135+ | <code >label</code > | <code >string</code > | falls back to ` value ` | Display label, also used for typeahead |
136+ | <code >disabled</code > | <code >boolean</code > | — | Prevent selection (stays keyboard-focusable) |
137137
138138` Select.Trigger ` , ` Select.Positioner ` , and ` Select.Popup ` take no additional props beyond
139139standard HTML attributes for their default element. ` Select.Portal ` accepts ` root ` .
0 commit comments