Option List
manifest-ui/option-listFreeBlock
Tag-style option selector with single or multiple selection modes.
Install it
npx shadcn@latest add https://ui.manifest.build/r/option-list.jsonSource
1'use client'23import { Button } from '@/components/ui/button'4import { cn } from '@/lib/utils'5import { Check } from 'lucide-react'6import { useEffect, useState } from 'react'78// Import types from shared types file to avoid circular dependencies9import type { Option } from './types'10// Re-export for backward compatibility11export type { Option } from './types'1213import { demoOptions } from './demo/selection'141516/**17 * ═══════════════════════════════════════════════════════════════════════════18 * OptionListProps19 * ═══════════════════════════════════════════════════════════════════════════20 *21 * Props for the OptionList component, which displays selectable options with22 * support for single or multiple selection modes.23 */24export interface OptionListProps {25 data?: {26 /** Array of selectable options to display. */27 options?: Option[]28 }29 actions?: {30 /** Called when the user confirms their selection. Returns selected option(s). */31 onSubmit?: (selected: Option[]) => void32 }33 appearance?: {34 /**35 * Enable multiple selection mode.36 * @default false37 */38 multiple?: boolean39 }40 control?: {41 /** Controlled selected index for single selection mode. */42 selectedOptionIndex?: number43 /** Controlled selected indexes for multiple selection mode. */44 selectedOptionIndexes?: number[]45 }46}4748/**49 * An option list component with single or multiple selection.50 * Uses compact pill/chip design with check indicators.51 *52 * Features:53 * - Single and multiple selection modes54 * - Optional descriptions and icons55 * - Disabled state support56 * - Controlled and uncontrolled usage57 *58 * @component59 * @example60 * ```tsx61 * <OptionList62 * data={{63 * options: [64 * { label: "Option A" },65 * { label: "Option B", description: "With description" },66 * { label: "Option C", disabled: true }67 * ]68 * }}69 * appearance={{ multiple: true }}70 * actions={{ onSelectOptions: (opts) => console.log(opts) }}71 * />72 * ```73 */74export function OptionList({ data, actions, appearance, control }: OptionListProps) {75 const resolved: NonNullable<OptionListProps['data']> = data ?? { options: demoOptions }76// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from Manifest UI
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Amount Inputamount-input | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Chat Conversationchat-conversation | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Contact Formcontact-form | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Date & Time Pickerdate-time-picker | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Cardevent-card | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Confirmationevent-confirmation | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Detailevent-detail | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Event Listevent-list | Manifest UI | Blocks | Free | 3 deps · 2 files |
