Select

Headless single-select primitives built for Roblox UI.

Experimental / feature-limited
@lattice-ui/select

currently single-value only

What It Is For

Use Select when the UI needs a compact single-choice picker with caller-owned trigger, value display, and overlay visuals.

It works well when options should open into a managed list but the user should not type freeform search text.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add select

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add select

npm package: @lattice-ui/select

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Providers

  • @lattice-ui/layer:PortalProvider? (optional)

Registry notes

  • Select.Content can use PortalProvider for robust overlays.

Public Exports

  • Select
  • Select.Root
  • Select.Trigger
  • Select.Value
  • Select.Portal
  • Select.Content
  • Select.Item
  • Select.Group
  • Select.Label
  • Select.Separator
  • SelectContent
  • SelectGroup
  • SelectItem
  • SelectLabel
  • SelectPortal
  • SelectRoot
  • SelectSeparator
  • SelectTrigger
  • SelectValue

State Model

  • Select.Root manages controlled or uncontrolled value and open state.
  • Items register in the root context, and the selected value resolves back to item text for Select.Value display.
  • If the current value no longer points at an enabled item, the root falls back to the first enabled registered item.

Key API

Select.Root

Use value, defaultValue, onValueChange, open, defaultOpen, and onOpenChange to connect the picker to app state.

Select.Value

Use placeholder when the control should show an explicit empty-state label before a value is chosen.

Select.Content

Use placement, offset, padding, and outside-interaction hooks for overlay geometry and dismissal.

Select.Item

Every item needs a stable value; use textValue when the rendered child text is not the same as the semantic value label.

Composition Patterns

Labeled trigger + portal content

Render the field shell in the trigger, then mount content in a portal so placement and dismissal stay reliable.

Small enumerated settings

Use Select when the option set is longer than a radio group but still small enough to browse without search.

Cautions / Limits

  • Current public behavior is single-value only; use Combobox, Checkbox, or ToggleGroup when the selection model is different.
  • Overlay behavior is portal-based, so set up PortalProvider near the app root for predictable mounting and stacking.
  • Keep content mounted through presence-aware exit motion; do not unmount the portal immediately if an exit transition should complete.

Decision Guides