Skip to content
Noksha UIv0.1
Colour theme

forms

Select

A listbox with typeahead, roving focus and collision-aware positioning — not a native select.

Examples

Single choice

A listbox, not a native `<select>` — so it can be styled, but it still posts with a form through a hidden input.

Type a letter with the list open to jump to it.

Grouped options

Own the source

Noksha ships as a package and as copy-paste source. Take the files and they are yours to change. These are read from the generated registry, so they are exactly what the library ships — never a paraphrase of it.

Take these files, and field, internal helpers along with them — the imports below point at them. Or let the CLI do it: npx @noksha-ui/cli add select writes them, follows the same dependency graph, and fixes up the imports.

export {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectRoot,
  SelectTrigger,
  selectTriggerVariants,
} from './select.js';
export type {
  SelectContentProps,
  SelectGroupProps,
  SelectItemData,
  SelectItemProps,
  SelectProps,
  SelectSize,
  SelectTriggerProps,
  SelectVariant,
} from './select.types.js';

API reference

SelectProps

PropTypeDescription
valuestring
defaultValuestring
onValueChange(value: string) => void
openboolean
defaultOpenboolean
onOpenChange(open: boolean) => void
namestringPosts with the surrounding form under this name.
disabledboolean
requiredboolean
invalidboolean
childrenReact.ReactNode

SelectTriggerProps

Also accepts everything from Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'>.

PropTypeDescription
variantSelectVariant
sizeSelectSize
placeholderReact.ReactNodeShown when nothing is selected.
renderValue(value: string | undefined) => React.ReactNodeReplaces the default rendering of the selected item's label.

SelectContentProps

Also accepts everything from React.HTMLAttributes<HTMLDivElement>.

PropTypeDescription
sideSide
alignAlign
sideOffsetnumber
collisionPaddingnumber
containerElement | null
matchTriggerWidthbooleanMake the list at least as wide as the trigger.

SelectItemProps

Also accepts everything from Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>.

PropTypeDescription
value*string
disabledboolean
childrenReact.ReactNodeThe label. Read directly out of the element tree, so it must be plain enough to render inside the trigger too — text, or text with an icon.
textValuestringOverrides the text used for type-to-select when children are not plain text.

SelectGroupProps

Also accepts everything from React.HTMLAttributes<HTMLDivElement>.

PropTypeDescription
labelReact.ReactNode

SelectItemData

PropTypeDescription
value*string
label*React.ReactNode
textValue*string
disabled*boolean