Select

Dropdown select built on bits-ui. Supports bindable value and custom placeholder.

Example

Selected: none

Props

PropTypeDefaultDescription
options{ value: string; label: string }[]Array of selectable options (required)
valuestring''Selected value (bindable)
onValueChange(value: string) => voidCallback when value changes
placeholderstring'Select...'Placeholder text
classstringAdditional CSS classes

Usage

<script>
  import { Select } from '@chrissnell/chonky-ui';
  let value = $state('');

  const options = [
    { value: 'a', label: 'Option A' },
    { value: 'b', label: 'Option B' }
  ];
</script>

<Select {options} bind:value placeholder="Choose..." />