Combo box (combo_box
)
A combo box helps users select an item from a large list of options.
🔗 External documentation.
ID | Label | Description | Schema |
---|---|---|---|
options | Options | Array of items with a text value. |
|
required | Required | The combo box component will be required in terms of native form validation. |
|
disabled | Disabled | The combo box component will be disabled / read-only. You can re-enable it by executing the enable procedure on the component. |
|
placeholder | Placeholder text | To update the placeholder text of the combo box, use the data-placeholder attribute. We recommend using a label or hint instead of a placeholder. |
|
default_value | Default value | The combo box will set this value as the default selection if it is found within the select options. |
|
id: combo_box
label: 'Combo box'
description: 'A combo box helps users select an item from a large list of options.'
group: 'Combo box'
homepage: 'https://designsystem.digital.gov/components/combo-box/'
props:
options:
id: options
label: Options
description: 'Array of items with a text value.'
schema:
type: array
items:
type: object
properties:
title:
type: string
attributes:
$ref: '#/$defs/attributes_value'
below:
type: object
required:
id: required
label: Required
description: 'The combo box component will be required in terms of native form validation.'
schema:
type: boolean
disabled:
id: disabled
label: Disabled
description: 'The combo box component will be disabled / read-only. You can re-enable it by executing the enable procedure on the component.'
schema:
type: boolean
placeholder:
id: placeholder
label: 'Placeholder text'
description: 'To update the placeholder text of the combo box, use the data-placeholder attribute. We recommend using a label or hint instead of a placeholder.'
schema:
type: string
default_value:
id: default_value
label: 'Default value'
description: 'The combo box will set this value as the default selection if it is found within the select options.'
schema:
type: string
examples:
preview:
id: preview
label: Preview
renderable:
'@component': combo_box
options:
-
type: option
value: apple
label: Apple
-
type: option
value: apricot
label: Apricot
-
type: option
value: banana
label: 'Banana Smoothie'
required: true
placeholder: 'Example placeholder'
default_value: apple