Skip to content

ButtonGroup - Web Component โ€‹

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

Parameters โ€‹

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

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

NameTypeDescription
buttonsobject[]Array of buttons
config
(optional)
stringConfiguration for the button group

The available slots for the component are:

NameTagsDescription
defaultspan

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.

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.

Playground โ€‹

Customization โ€‹

HTML Examples โ€‹

Imports
html
<link rel="stylesheet" href="/0.4.5/@zurich/web-components/styles.css" />
<script type="module" src="/0.4.5/@zurich/web-components/button.js"></script>
<script type="module" src="/0.4.5/@zurich/web-components/button-group.js"></script>
Code
html
<z-button-group
  buttons='[{"config":"negative", "icon": "thumbs-down:line", "content": "Dislike"},{"config":"positive", "icon": "thumbs-up:line", "content": "Like"},{"config":"primary", "icon": "chat:line", "content": "Comment"}]'>

</z-button-group>