Hyunsui
Docs
Select
Accessible, composable listbox primitives that follow the Radix-style API while using Floating UI for positioning.
Anatomy
Import the building blocks and compose them to match your UI.
API Reference
Root
Provides context, manages controlled/uncontrolled selection and open state, wires dismissal handlers, portals the list, and syncs form values when a name is provided.
PropTypeDefault
value
string | undefined-
defaultValue
string-
onValueChange
function-
open
boolean-
defaultOpen
booleanfalse
onOpenChange
function-
disabled
booleanfalse
closeOnEscape
booleantrue
closeOnOutside
booleantrue
offset
number6
disableLockScroll
booleantrue
container
Element | DocumentFragment | nulldocument.body
name
string-
id
stringauto-generated
Trigger
The interactive button that toggles the dropdown. Inherits every button prop and exposes data-state for styling.
PropTypeDefault
type
stringbutton
onClick
React.MouseEventHandler<HTMLButtonElement>-
Data AttributeValue
data-state
"open" | "closed"
Value
Displays the currently selected item or a placeholder, and updates via context whenever Select.Item is chosen.
PropTypeDefault
placeholder
ReactNodenull
children
ReactNode-
Content
The floating list. Rendered inside a portal derived from Select.Root, supports forceMount for exit animations, and exposes placement/state attributes from Floating UI.
PropTypeDefault
forceMount
booleanfalse
Data AttributeValue
data-state
"open" | "closed"
data-placement
"top" | "bottom"
Item
Individual option within the list. Registers its label with the root, updates selection on click, and exposes data-state / data-disabled for styling.
PropTypeDefault
value
string-
disabled
booleanfalse
textValue
ReactNodechildren
Data AttributeValue
data-state
"selected" | "unselected"
data-disabled
""