Combobox

The Combobox component combines a text input with a dropdown list, allowing users to either type or select from options.

Import

<script>
  import { Combobox, Option } from 'svelte-fluentui';
</script>
svelte

Basic Usage

<Combobox label="Search or select city">
  <Option value="new-york">New York</Option>
  <Option value="london">London</Option>
  <Option value="tokyo">Tokyo</Option>
</Combobox>
svelte

With Custom Values

<Combobox label="Tags" allowCustomValue>
  <Option value="work">Work</Option>
  <Option value="personal">Personal</Option>
  <Option value="urgent">Urgent</Option>
</Combobox>
svelte

Properties

PropertyTypeDefaultDescription
labelstringundefinedLabel text for the combobox
valuestring''Current value
placeholderstringundefinedPlaceholder text
allowCustomValuebooleanfalseAllow typing custom values
disabledbooleanfalseWhether the combobox is disabled

Events

EventDescription
on:changeFired when the value changes
on:inputFired during typing