A2ChoicePicker
Multi/single selection card component with chips style support.
Props
| Property | Type | Default | Description |
|---|---|---|---|
label | string | - | Label text |
options | array | [] | Options list |
variant | default | mutuallyExclusive | default | Selection mode |
displayStyle | default | chips | default | Display style |
required | boolean | false | Required field |
disabled | boolean | false | Disabled state |
defaultValue | array | 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
Single-select Example
Options with Description
Required and Disabled States
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" }
}