Native Select
A styled native HTML select element with consistent design system integration.
For a styled select component, see the Select component.
Installation
Usage
<NativeSelect>
<NativeSelectOption value="">Select a fruit</NativeSelectOption>
<NativeSelectOption value="apple">Apple</NativeSelectOption>
<NativeSelectOption value="banana">Banana</NativeSelectOption>
<NativeSelectOption value="blueberry">Blueberry</NativeSelectOption>
<NativeSelectOption value="pineapple">Pineapple</NativeSelectOption>
</NativeSelect>Composition
Simple
Options placed directly under NativeSelect (no NativeSelectOptGroup).
NativeSelect
├── NativeSelectOption
├── NativeSelectOption
├── NativeSelectOption
└── NativeSelectOptionWith groups
Use NativeSelectOptGroup to organize options into categories.
NativeSelect
├── NativeSelectOptGroup
│ ├── NativeSelectOption
│ └── NativeSelectOption
└── NativeSelectOptGroup
├── NativeSelectOption
└── NativeSelectOptionGroups
Use NativeSelectOptGroup to organize options into categories.
Disabled
Add the disabled parameter to the NativeSelect component to disable the select.
Invalid
Use aria-invalid to show validation errors and the data-invalid attribute to the Field component for styling.
Native Select vs Select
- Use
NativeSelectfor native browser behavior, better performance, or mobile-optimized dropdowns. - Use
Selectfor custom styling, animations, or complex interactions.
RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.
API Reference
NativeSelect
Other attributes are passed to the element it renders.
NativeSelectOptGroup
Other attributes are passed to the element it renders.
NativeSelectOption
Other attributes are passed to the element it renders.