FontPicker
Client dropdown to persist monospace vs default reading font via useFontPreference.
Exports
FontPicker— named and default exportFontOption—'monospace' | 'default'- Internal
FONT_OPTIONScatalog: Code (Fira Code) vs Reading (system stack)
Props (FontPickerProps)
| Prop | Type | Default | Behavior |
|---|---|---|---|
className | string | '' | On root font-picker |
onChange | (font: FontOption) => void | — | Called after successful setPreference |
Behavior
- Returns
nulluntil client mount (avoids hydration mismatch). - Trigger: listbox pattern, keyboard Enter/Space/Escape,
aria-haspopup, disabled whileisUpdating. - Options show name, description, live
fontFamilypreview; checkmark on selected. - Click-outside closes dropdown (
mousedownon document).
Sources: src/app/components/font-picker/FontPicker.tsx, src/app/components/font-picker/FontPicker.css, @lib/context/UserPreferencesContext