Glin UI
Primitive / Atom

Select

Native select with glass, liquid, matte, and utility variants.

Edit on GitHub

Preferences

Applies to every workspace you belong to.

Used for menus and emails.

Schedules and digests follow it.

How dates appear in tables.

Installation

Install from
pnpm dlx @glinui/cli@latest add select

Prefer the package?

Usage

Sizes

import { Select } from "@glinui/ui"
const opts = [{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]
export function Demo() {
return (
<div className="space-y-3 max-w-xs">
<Select size="sm" options={opts} placeholder="Small" />
<Select size="md" options={opts} placeholder="Medium" />
<Select size="lg" options={opts} placeholder="Large" />
</div>
)
}

Variants

import { Select } from "@glinui/ui"
export function Demo() {
return (
<div className="grid gap-3 sm:grid-cols-2">
<Select variant="glinr" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="glinr" />
<Select variant="solid" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="solid" />
<Select variant="plain" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="plain" />
<Select variant="soft" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="soft" />
<Select variant="outline" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="outline" />
<Select variant="ghost" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="ghost" />
</div>
)
}

Glass (opt-in)

Glass is opt-in and needs a backdrop behind it: pick Photo or Vivid in the stage backdrop switcher.

import { Select } from "@glinui/ui"
export function Demo() {
return (
<Select variant="glass" options={[{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }]} placeholder="Glass" />
)
}

Surface Variants

import { Select } from "@glinui/ui"

const options = [
  { label: "Alpha", value: "alpha" },
  { label: "Beta", value: "beta" }
]

export function SelectVariantsDemo() {
  return (
    <div className="space-y-3">
      <Select variant="default" aria-label="Default select" options={options} placeholder="Default" />
      <Select variant="glass" aria-label="Glass select" options={options} placeholder="Glass" />
      <Select variant="liquid" aria-label="Liquid select" options={options} placeholder="Liquid" />
      <Select variant="matte" aria-label="Matte select" options={options} placeholder="Matte" />
      <Select variant="outline" aria-label="Outline select" options={options} placeholder="Outline" />
      <Select variant="ghost" aria-label="Ghost select" options={options} placeholder="Ghost" />
    </div>
  )
}

With Placeholder

import { Select } from "@glinui/ui"

export function SelectPlaceholderDemo() {
  return (
    <Select
      aria-label="Placeholder select"
      options={[{ label: "Option A", value: "a" }, { label: "Option B", value: "b" }]}
      placeholder="Choose an option..."
    />
  )
}

Disabled Option

import { Select } from "@glinui/ui"

export function SelectDisabledOptionDemo() {
  return (
    <Select
      aria-label="Status select"
      options={[
        { label: "Available", value: "available" },
        { label: "Unavailable", value: "unavailable", disabled: true },
        { label: "Also available", value: "also" }
      ]}
      placeholder="Select status"
    />
  )
}

Disabled Select

import { Select } from "@glinui/ui"

export function SelectDisabledDemo() {
  return (
    <Select
      aria-label="Disabled select"
      disabled
      options={[{ label: "React", value: "react" }]}
      placeholder="Disabled select"
    />
  )
}

Accessibility

  • Native `select` semantics with keyboard navigation.
  • Pair with `<label>` or `aria-label`.
  • Renders a native `<select>` element for maximum browser and assistive technology compatibility.
  • Pair with a `<label>` using `htmlFor` or provide an `aria-label` when no visible label exists.
  • Placeholder text should not be used as the sole accessible label.
  • Disabled individual options use the native `disabled` attribute on `<option>` elements.

Keyboard Interactions

KeyAction
Enter / SpaceOpen the select dropdown.
Arrow Up / DownNavigate options.

ARIA Attributes

  • `role="combobox"` native
  • `aria-expanded`
  • `aria-selected`

Reduced Motion

No animation dependencies.

Select does not use custom animations; open/close behavior is controlled by the browser's native dropdown.

API Reference

PropTypeRequiredDefaultDescription
optionsSelectOption[]Yes-Array of { label, value, disabled? }.
placeholderstringNo-Disabled placeholder option text.
variantControlVariantPropNoambient (glinr)Surface look. Omit to follow the ambient design style. Glass is opt-in.
sizeunknownNomdHeight scale.
disabledboolean-falseDisables interaction.

Source

Import directly from the package or browse the source on GitHub. Click any file to view it.

Import

import { Select } from "@glinui/ui"

Source Files

Dependencies

@glinui/ui

Generated API Snapshot

Beta

Auto-extracted from TypeScript source in packages/ui/src/components/select.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.

Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata

Primary Props Type

SelectProps

SelectProps

PropTypeRequiredDefaultDescription
optionsSelectOption[]Yes--
placeholderstringNo--
sizeunknownNo"md"Variant option from selectSizeVariants.
variantControlVariantPropNo-Surface look. Omit to follow the ambient design style. Same vocabulary as Input.