Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
Forms

NativeSelect

Styles the browser-native select element.

FrameworksAstro · React · Elements

Registry commandlumen add NativeSelect

InteractionNative markup

01

See it and copy it

Framework example

Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroSame visual contract, native framework API

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
astro
---
import { NativeSelect } from '@santi020k/lumen-astro'
---

<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
  <label for="ex-native-select-plan">Plan</label>
  <NativeSelect id="ex-native-select-plan" name="plan" placeholder="Choose a plan">
    <option value="free">Free</option>
    <option value="pro">Pro</option>
    <option disabled value="enterprise">Enterprise (contact sales)</option>
    <option value="team">Team</option>
  </NativeSelect>
  <label for="ex-native-select-billing">Billing period</label>
  <NativeSelect
    id="ex-native-select-billing"
    name="billing"
    options={['Monthly', 'Yearly']}
    placeholder="Choose a billing period"
    visualSize="sm"
  />
  <label for="ex-native-select-region">Region</label>
  <NativeSelect
    disabled
    id="ex-native-select-region"
    name="region"
    options={['North America', 'Europe']}
    placeholder="Locked to workspace"
    visualSize="lg"
  />
</div>
Edit NativeSelect in browser
02

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 NativeSelect
lumen add NativeSelect

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
optionsArray<string | { label, value, disabled? }>[]Creates native option elements.
placeholderstring-Adds a disabled placeholder option.
sizenumbernative defaultSets the number of visible native options.
visualSize, visual-size"default" | "sm" | "lg""default"Controls select height and font size. Use visualSize in Astro/React and visual-size in Elements.
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.

Web docsFull catalog