Skip to content

A2ChoicePicker

Multi/single selection card component with chips style support.

Props

PropertyTypeDefaultDescription
labelstring-Label text
optionsarray[]Options list
variantdefault | mutuallyExclusivedefaultSelection mode
displayStyledefault | chipsdefaultDisplay style
requiredbooleanfalseRequired field
disabledbooleanfalseDisabled state
defaultValuearray | string | number[]Default value

Option Configuration

typescript
interface ChoiceOption {
  label: string       // Display text
  value: string | number  // Option value
  description?: string    // Description text (optional)
  disabled?: boolean     // Disabled (optional)
}

Selection Modes

Multi-select Mode (default)

Users can select multiple options.

Single-select Mode (mutuallyExclusive)

Users can only select one option. Clicking a new option automatically deselects the previous one.

Basic Example

Basic Multi-select
无内容

Single-select Example

Mutually Exclusive Single-select
无内容

Options with Description

Options with Description
无内容

Required and Disabled States

Required and Disabled
无内容

JSON Schema

json
{
  "id": "pickerId",
  "component": "ChoicePicker",
  "label": "Select option",
  "variant": "mutuallyExclusive",
  "displayStyle": "chips",
  "required": true,
  "options": [
    { "label": "Option 1", "value": "opt1", "description": "Description 1" },
    { "label": "Option 2", "value": "opt2" },
    { "label": "Disabled option", "value": "opt3", "disabled": true }
  ],
  "value": { "path": "/form/choice" }
}

A2UI Documentation