Skip to content

    Browse components

    Select

    Custom listbox select in the native top layer: grouped options with icons, a gliding highlight, drawn check marks, typeahead, full keyboard support and a real form value.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/select

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/select.json

    Usage

    import { Select } from "@/components/ui/select";
    
    <Select
      name="fruit"
      placeholder="Pick a fruit"
      options={[
        { label: "Fruits", options: [{ value: "apple", label: "Apple" }, { value: "pear", label: "Pear" }] },
      ]}
    />

    Props

    PropTypeDefaultDescription
    placeholderstring"Select an option"Shown when nothing is selected.
    disabledbooleanfalseDisable the trigger.
    requiredbooleanfalseNative form validation when `name` is set.
    optionsReactNode—(SelectOption | { label, options: SelectOption[] })[]; SelectOption = { value, label, icon?, description?, disabled? }.
    valueReactNode—Selected value (controlled, with onValueChange).
    defaultValueReactNode—Initial value (uncontrolled).
    nameReactNode—Form field name; submitted like a native select.
    classNamestring—Extra classes for the root element.