ButtonGroup

/libs/granite/ui/components/coral/foundation/form/buttongroup

A container to group a set of buttons. The user is able to select one or more buttons. The selected values are then submitted during form submission.

It extends Field component.

It has the following content structure:

granite:FormButtonGroup
  1. granite:FormField
  2. granite:container
namestring

The name that identifies the field when submitting the form.

selectionMode
  1. none
  1. none
  2. single
  3. multiple

The selection mode.

none
Nothing can be selected.
single
Only a single item can be selected.
multiple
Multiple items can be selected.
deleteHintboolean
  1. true

true to generate the SlingPostServlet @Delete hidden input based on the name.

requiredboolean

Indicates if the field is mandatory to be filled.

validationstring
multiple

The name of the validator to be applied. E.g. foundation.jcr.name. See validation in Granite UI.

ignoreDataboolean

If false, the checked status is based on matching the form values by name and value properties. Otherwise, the form values are not matched, and the checked status of each item is based on its checked property.

Each item has the following content structure:

granite:FormButtonGroupItem
  1. granite:commonAttrs
valuestring

The value of the item.

disabledboolean

Indicates if the item is in disabled state.

checkedboolean

true to pre-check this item, false otherwise.

textstring
i18n

The text of the item.

hideTextboolean

Visually hide the text. It is RECOMMENDED that every item has a text for a11y purpose. Use this property to hide it visually, while still making it available for a11y.

iconstring

The icon name. e.g. “search”.

iconSizestring
  1. S
  1. XS
  2. S
  3. M
  4. L

The size of the icon.