# Select Horizontal scrollable selector component for choosing between multiple options. ## Features - ✅ Horizontal scrolling options - ✅ Icons and emoji support - ✅ Optional subtitles and descriptions - ✅ Loading and error states - ✅ Info toggle for details - ✅ Fully customizable colors - ✅ Disabled state ## Installation ```bash npx @memoro/ui add select ``` **Dependencies:** text, icon ## Usage ### Basic Select ```tsx import { Select, SelectOption } from '@/components/ui/Select'; const options: SelectOption[] = [ { id: '1', label: 'Option 1', icon: '🎨' }, { id: '2', label: 'Option 2', icon: '🖼️' }, { id: '3', label: 'Option 3', icon: '📸' }, ]; ``` ### With Subtitles and Descriptions ```tsx const options: SelectOption[] = [ { id: 'basic', label: 'Basic', icon: '⚡', subtitle: 'Fast & Simple', description: 'Quick generation with basic settings', }, { id: 'advanced', label: 'Advanced', icon: '🚀', subtitle: 'Powerful', description: 'Full control over all parameters', }, ]; {}} loading={true} /> ``` ### Error State ```tsx ``` ### Custom Width ```tsx setSelectedSize(opt.id)} />; ``` ### Style Selector ```tsx const styleOptions: SelectOption[] = [ { id: 'realistic', label: 'Realistic', icon: '📷' }, { id: 'artistic', label: 'Artistic', icon: '🎨' }, { id: 'cartoon', label: 'Cartoon', icon: '🎭' }, { id: 'anime', label: 'Anime', icon: '🌸' }, ]; setSelectedModel(opt.id)} />; ``` ### Async Loading ```tsx function ModelSelector() { const [models, setModels] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const loadModels = async () => { setLoading(true); setError(null); try { const data = await fetchModels(); setModels(data); } catch (err) { setError('Failed to load models'); } finally { setLoading(false); } }; useEffect(() => { loadModels(); }, []); return ( setTheme(opt.id)} minWidth={100} />; ``` ## Info Toggle When options have `subtitle` or `description`: - Info icon appears in header - Clicking toggles visibility of: - Subtitles under each option - Description panel for selected option ## States ### Loading - Shows spinner with "Loading..." text - Disabled interaction ### Error - Shows error message - Optional retry button via `onRetry` ### Disabled - Reduces opacity to 0.5 - Prevents selection ## Common Patterns ### Multi-Section Select ```tsx setSelectedQuality(opt.id)} /> ``` ### Conditional Options ```tsx const options = isPremium ? [...basicOptions, ...premiumOptions] : basicOptions;