Select (Native)

A native HTML select element with custom styling for simple dropdown selection needs.

Anatomy

<script>
  import { NativeSelect } from "@saas-ui/svelte/components/native-select";
</script>

<NativeSelect>
  <option value="">Select an option</option>
  <option value="option1">Option 1</option>
  <option value="option2">Option 2</option>
  <option value="option3">Option 3</option>
</NativeSelect>

Examples

Basic

Basic native select with default styling and placeholder option.

Sizes

Use the size prop to change the size. Available sizes: xs, sm, md, lg, xl.

Variants

Use the variant prop to change the visual style. Available variants: outline, subtle, plain.

With Validation

Native select integrated with form validation for required field handling.

Props

Prop Type Default Description
variant outline | subtle | plain outline The visual style of the component.
size xs | sm | md | lg | xl md The size of the component.
invalid boolean false Whether the component is in an invalid state.
disabled boolean false Whether the component is disabled.
class text - Additional CSS classes to apply.