Skip to main content

Starwind UI v1.16 is now available! With new popover and more components With new input-group, native-select, and popover components

Native Select

Info

For a styled select component, see the Select component.

Installation

Usage

Groups

Use NativeSelectOptGroup to organize options into categories.

Disabled

Add the disabled prop to disable the entire select, or disable specific options.

Invalid

Use aria-invalid to show validation and error states.

Please select a framework.

Size

Use the size prop to render compact or larger controls.

Native Select vs Select

Use Native Select for simple forms when you want browser-native behavior and mobile pickers. Use Select when you need custom popover behavior, search, and advanced interaction patterns.

Tip

Prefer NativeSelect for straightforward form controls and mobile-first flows where native platform pickers are beneficial. Choose Select when you need richer UI features like searchable options, custom popover positioning, and advanced interactions.

RTL

Set dir="rtl" to support right-to-left languages.

API Reference

NativeSelect

The main select component that wraps the native HTML <select> element.

PropTypeDefault
size"sm" | "md" | "lg""md"
disabledbooleanfalse
defaultValuestring-
namestring-
idstring-
aria-invalidbooleanfalse
classstring-
<NativeSelect name="framework" defaultValue="astro">
<NativeSelectOption value="astro">Astro</NativeSelectOption>
<NativeSelectOption value="next">Next.js</NativeSelectOption>
</NativeSelect>

Additional Notes:

  • This component accepts all native <select> attributes.
  • Use the named icon slot to replace the default chevron icon.

NativeSelectOption

Represents an individual option within the select.

PropTypeDefault
valuestring-
disabledbooleanfalse
selectedbooleanfalse
classstring-
<NativeSelectOption value="apple">Apple</NativeSelectOption>

NativeSelectOptGroup

Groups related options together for better organization.

PropTypeDefault
labelstringRequired
disabledbooleanfalse
classstring-
<NativeSelectOptGroup label="Fruits">
<NativeSelectOption value="apple">Apple</NativeSelectOption>
<NativeSelectOption value="banana">Banana</NativeSelectOption>
</NativeSelectOptGroup>

Changelog

v1.0.0

  • Initial release with starwind v1.16.0