Skip to content

ButtonGroup - Web Component โ€‹

The ButtonGroup component can be used imported from:

Playground โ€‹

Parameters โ€‹

The Web component uses the <z-button-group> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
buttonsobject[]Array of buttons
configstringConfiguration for the button group

Events โ€‹

This component has events. Check the documentation about how to use the events.

NamePayloadDescription

Slots โ€‹

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanSlots for buttons

Parameters use โ€‹

buttons โ€‹

The buttons parameter is an array of objects that define the buttons inside the ButtonGroup. Each object must contain button component properties to define the button.

We can use <z-button> tags to define the values of buttons

Button 1DislikeLike

config โ€‹

The config parameter is a string that defines the button group configuration. You can configure the type and the size of the buttons inside the group.

It works with slotted inputs too:

DislikeLike

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹