CentercodeDitto
DittoPorygonAPI

DittoMultiSelect

Multi-selection dropdown with optional grouping, search, and checkboxes

Overview

DittoMultiSelect is a unified multi-select component that replaces GroupedMultiSelect. It supports optional grouping (flat list by default), optional search, checkbox selection, icons on options and groups, and smart trigger display showing selected count or single label.

Key Features

  • Optional grouping - flat list when groups omitted
  • Checkbox selection with visual checkmarks
  • Optional search filtering (opt-in via searchable prop)
  • Smart trigger: single label or "N selected"
  • Badge showing selected count per group
  • Clearable selection with clear all button
  • Size variants (default, sm)

When to Use

Use DittoMultiSelect when users need to select multiple options from a list. Add groups to organize options into categories. Enable search for lists with many options. Common use cases include filtering by multiple criteria, selecting tags, or trait assignment.

Skip When

  • Single selection needed -> Use DittoSingleSelect
  • Visual card selection -> Use CardPicker
  • Inline tag management -> Use TagSelect

Interactive Examples

Live Demo

Selected: None

Pre-selected Items

Selected: windows-11, iphone

Flat List (No Groups)

Selected: red, blue

With Search

Selected: None

Disabled State

Size Variants

Default

Small

Interfaces

DittoSelectOption

PropTypeDescription
valuestringUnique identifier for the option
labelstringDisplay label
iconIconDefinition?Optional Font Awesome icon
groupIdstring?Parent group ID (only when using groups)
disabledboolean?Disable this option

DittoSelectGroup

PropTypeDescription
idstringUnique identifier for the group
labelstringDisplay label for the group header
iconIconDefinition?Optional icon for the group header

Props Reference

PropTypeDefaultDescription
optionsDittoSelectOption[]requiredArray of selectable options
groupsDittoSelectGroup[]-Optional groups for categorizing options
valuestring[]requiredArray of currently selected option values
onChange(value: string[]) => voidrequiredCallback when selection changes
placeholderstringSelect...Text shown when nothing is selected
searchablebooleanfalseEnable search filtering
searchPlaceholderstringSearch...Placeholder for search input
clearablebooleanfalseShow clear all button when items selected
maxItemsnumber-Maximum number of items that can be selected
size'sm' | 'default''default'Size variant
disabledbooleanfalseDisable all interactions
classNamestring-Additional CSS classes for the trigger button

Usage

import {
  DittoMultiSelect,
  type DittoSelectOption,
  type DittoSelectGroup
} from '@/ui/components';
import { faDesktop, faMobile, faDisplay, faLaptop } from '@fortawesome/duotone-regular-svg-icons';

// Define options (flat array)
const options: DittoSelectOption[] = [
  { value: 'windows-11', label: 'Windows 11', icon: faDisplay, groupId: 'os' },
  { value: 'macos', label: 'macOS Sonoma', icon: faLaptop, groupId: 'os' },
  { value: 'iphone', label: 'iPhone', groupId: 'device' },
  { value: 'android', label: 'Android', groupId: 'device' },
];

// Define groups (optional - omit for flat list)
const groups: DittoSelectGroup[] = [
  { id: 'os', label: 'Operating System', icon: faDesktop },
  { id: 'device', label: 'Device Type', icon: faMobile },
];

// Usage
const [selected, setSelected] = useState<string[]>([]);

<DittoMultiSelect
  options={options}
  groups={groups}           // Optional - flat list if omitted
  value={selected}
  onChange={setSelected}
  placeholder="Filter by traits..."
  searchable                // Optional - opt-in search
  clearable                 // Optional - clear all button
/>