Skip to content
Forms

Select

Composable dropdown with groups.

Import

tsx
import { Select } from "@cronus-ui/ui";
bash
npx cronus-ui add select

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component SelectDefault layout:inline style:select {
  label "Select a plan"
  text "Select a plan"
  text "Free"
  text "Pro"
  text "Team"
}

page "/audit/select/default" type:custom {
  use SelectDefault
}

API Reference

Generated from the component's exported types.

SelectProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Root>

Skip SelectProps props table
PropTypeDefaultDescription
value
string—Controlled value.
defaultValue
string—Uncontrolled initial value.
onValueChange
(value: string) => void—Called when the value changes.
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
disabled
boolean—Disables pointer and keyboard interaction.
required
boolean—Marks the control as required.
name
string—Submitted name when used in a form.
dir
"ltr" | "rtl"—Reading direction. Inherits from the document when omitted.

SelectGroupProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group>

Skip SelectGroupProps props table
PropTypeDefaultDescription
children
ReactNode—Contents of the component.

SelectValueProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Value>

Skip SelectValueProps props table
PropTypeDefaultDescription
placeholder
string—Placeholder shown when the value is empty.
asChild
boolean—Render as the child element via Slot.

SelectTriggerProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>

Skip SelectTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
disabled
boolean—Disables pointer and keyboard interaction.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

SelectScrollUpButtonProps

Extends ComponentPropsWithoutRef< typeof SelectPrimitive.ScrollUpButton >

Skip SelectScrollUpButtonProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

SelectScrollDownButtonProps

Extends ComponentPropsWithoutRef< typeof SelectPrimitive.ScrollDownButton >

Skip SelectScrollDownButtonProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

SelectContentProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Content>

Skip SelectContentProps props table
PropTypeDefaultDescription
position
"item-aligned" | "popper"—How the list is positioned relative to the trigger.
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
sideOffset
number—Distance in pixels from the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
alignOffset
number—Offset along the alignment axis.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

SelectLabelProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Label>

Skip SelectLabelProps props table
PropTypeDefaultDescription
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

SelectItemProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item>

Skip SelectItemProps props table
PropTypeDefaultDescription
value
string—Controlled value.
disabled
boolean—Disables pointer and keyboard interaction.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.

SelectSeparatorProps

Extends ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>

Skip SelectSeparatorProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.