Combobox

Headless combobox primitives for Roblox UI with typed filtering and enforced option selection.

Stable direction
@lattice-ui/combobox

Part of the stable direction toward v1.0.

What It Is For

Use Combobox when the user needs to type into a field and still commit to one option from a registered list.

It sits between Select and TextField: the package owns list filtering, option registration, and value/input synchronization, while you own the rendered UI.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add combobox

Monorepo local script

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

pnpm lattice add combobox

npm package: @lattice-ui/combobox

Peer dependencies

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

Providers

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

Registry notes

  • Combobox content can be portal-mounted via PortalProvider.

Public Exports

  • Combobox
  • Combobox.Root
  • Combobox.Trigger
  • Combobox.Input
  • Combobox.Value
  • Combobox.Portal
  • Combobox.Content
  • Combobox.Item
  • Combobox.Group
  • Combobox.Label
  • Combobox.Separator
  • defaultComboboxFilter
  • filterComboboxOptions
  • resolveComboboxInputValue
  • resolveForcedComboboxValue

State Model

  • Combobox.Root can control three values independently: selected value, typed inputValue, and open.
  • When the list closes, the input is synchronized back to the selected option text.
  • Opening logic, filtering, and item registration all live in the root context, and disabled or read-only roots reject writes.

Key API

Combobox.Root

Use value, inputValue, open, and their default/onChange pairs when integrating with external form or search state.

Combobox.Input

This is the typed query surface; placeholder, disabled, and readOnly are the key integration points.

Combobox.Content

Use placement, offset, padding, and outside-interaction callbacks for overlay positioning and dismissal behavior.

filterFn

Override filterFn when case-insensitive substring matching is not enough for your search rules.

Composition Patterns

Searchable settings picker

Compose Trigger, Value, and Input together so the currently selected value and the live filter query are both visible.

Strict option selection

Use Combobox.Item for every valid value and let the package re-sync the input text to the chosen option when the list closes.

Cautions / Limits

  • This package is still a selection control, not a freeform text field; the stable committed value comes from registered items.
  • Because content is portal-based, use PortalProvider when you need predictable overlay mounting and display order.

Decision Guides