121
GitHub
Forms

Combobox

Combines text entry and option selection.

FrameworksAstro · React · Elements

Registry commandlumen add Combobox

InteractionEnhanced runtime

01

See it in context

Preview

02

Copy a working example

Usage

Astro examples assume UIPrimitives is mounted once in your root layout. Do not add the runtime next to each component instance.

astro
---
import { Combobox } from '@santi020k/lumen-astro'
---

<Combobox
  label="Framework"
  list="ex-frameworks"
  options={[
    'Astro',
    { label: 'React', value: 'react' },
    { label: 'Web Components', value: 'web-components' },
    { label: 'Vue', value: 'vue', disabled: true }
  ]}
  placeholder="Search frameworks"
/>
---
import { Combobox } from '@santi020k/lumen-astro'
---

<Combobox
  label="Framework"
  list="ex-frameworks"
  options={[
    'Astro',
    { label: 'React', value: 'react' },
    { label: 'Web Components', value: 'web-components' },
    { label: 'Vue', value: 'vue', disabled: true }
  ]}
  placeholder="Search frameworks"
/>
03

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add Combobox
lumen add Combobox

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
liststringrequiredSets the id for the generated listbox and connects it to the combobox input.
labelstring-Adds a visible label above the input.
optionsArray<string | { label, value, disabled? }>[]Creates selectable listbox options from strings or value/label objects.
typeHTML input type"text"Sets the native input type.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Keyboard interactions

Keyboard behavior provided by the Astro UIPrimitives runtime for this component.

KeyAction
Escape in input or optionClose the listbox. Escape on an option also returns focus to the input.
ArrowDown, ArrowUp in inputOpen the listbox and move focus to the first or last visible option.
Enter in inputSelect the first visible option.
Enter, Space on an optionSelect the focused option.
ArrowDown, ArrowUp on an optionMove focus through visible options, wrapping at the ends.
Home, End on an optionMove focus to the first or last visible option.