Prebuilt Layer Layer III

Searchable Selector

A searchable dropdown selector with circle avatar, name, and double arrow trigger. Filters items by label or value and shows avatar initials or image.

01

Props

PropTypeDefaultDescription
idstringrequired

The unique identifier for the selector wrapper.

itemsArray<{ value: string; label: string; avatarText?: string; avatarImage?: string }>required

Array of selectable items with value, label, and optional avatarText or avatarImage.

selectedValuestring | undefinedundefined

The selected item value. Supports $bindable.

placeholderstring'Select an option'

Placeholder when no item is selected.

searchPlaceholderstring'Search...'

Placeholder for the search input.

disabledbooleanfalse

Whether the selector is disabled.

variantstring''

User-defined variant name, added to the root element. Style it with a CSS rule that starts from the root.

02

Samples

1. Basic Searchable Selector

Dropdown with search, circle avatar (initials), name, and double arrow on trigger. Filters by label and value.

Selected: emre

<script>
  import { SearchableSelector } from 'fluid-ui-svelte/prebuilt';
 
  const items = [
    { value: "emre", label: "Emre Ayaz", avatarText: "EA" },
    { value: "alice", label: "Alice Johnson", avatarText: "AJ" },
    { value: "bob", label: "Bob Smith", avatarText: "BS" }
  ];
 
  let selectedValue = $state("emre");
</script>
 
<SearchableSelector
  id="user-selector"
  {items}
  bind:selectedValue
  placeholder="Select a user"
  searchPlaceholder="Search users..."
/>

2. With Avatar Images

Uses avatarImage URL for circle avatar instead of initials. Falls back to initials if no image.

Selected: none

<script>
  import { SearchableSelector } from 'fluid-ui-svelte/prebuilt';
 
  const items = [
    { value: "emre", label: "Emre Ayaz", avatarImage: "https://picsum.photos/id/1011/100/100" },
    { value: "sarah", label: "Sarah Connor", avatarImage: "https://picsum.photos/id/1027/100/100" }
  ];
 
  let selectedValue = $state();
</script>
 
<SearchableSelector
  id="user-selector-images"
  {items}
  bind:selectedValue
  placeholder="Choose a person"
  searchPlaceholder="Search people..."
/>