FontPickerRoot
FontPickerRoot is a headless searchable font picker built on Reka UI Combobox primitives.
Props
| Prop | Default | Type |
|---|---|---|
listFamilies*Async source for available font families. | — | () => Promise<string[]> |
triggerClassOptional class for the default trigger. | — | string | undefined |
contentClassOptional class for dropdown content. | — | string | undefined |
itemClassOptional class for default items. | — | string | undefined |
searchClassOptional class for the search input. | — | string | undefined |
viewportClassOptional class for the scroll viewport. | — | string | undefined |
emptyClassOptional class for empty states. | — | string | undefined |
emptySearchTextText shown when search returns no fonts. | — | string | undefined |
emptyFontsTextText shown when no fonts are available. | — | string | undefined |
emptyFontsHintOptional helper text for the empty-fonts state. | — | string | undefined |
Model
| Prop | Default | Type |
|---|---|---|
v-model*Selected font family. | — | string |
Events
| Event | Payload | Description |
|---|---|---|
select | family: string | Emitted after a font family is selected. |
Slots
| Slot | Props | Description |
|---|---|---|
trigger | { value: string, open: boolean } | Custom trigger content. |
search | { searchTerm: string, setInputRef: (el: HTMLInputElement | null) => void } | Custom search input slot. |
item | { family: string, selected: boolean } | Custom item renderer. |
indicator | { selected: boolean } | Custom selected indicator. |
empty | — | Shown when no fonts are available. |
Example
vue
<FontPickerRoot v-model="fontFamily" :list-families="listFamilies">
<template #trigger="{ value }">
<button class="w-full truncate">{{ value }}</button>
</template>
</FontPickerRoot>