121
GitHub
Forms

NativeSelect

Styles the browser-native select element.

FrameworksAstro · React · Elements

Registry commandlumen add NativeSelect

InteractionNative markup

01

See it in context

Preview

02

Copy a working example

Usage

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"
    size="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"
    size="lg"
  />
</div>
---
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"
    size="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"
    size="lg"
  />
</div>
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 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.
size"default" | "sm" | "lg""default"Controls select height and font size.
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.