<vega-button-circle
variant='primary'
size='large'
icon='hb-menu'
label='This labels the button'
disabled=false
>
</vega-button-circle>
<vega-button-circle
variant='primary'
size='small'
icon='search'
label='This is the label'
disabled=false
danger=false
>
</vega-button-circle>
<vega-button-circle
variant='primary'
size='small'
icon='close'
label='This is a danger button'
disabled=false
danger=true
>
</vega-button-circle>
The vega-button-circle
element can be used as a button on mobile devices, or can be used as a floating element on a page. This type of floating element is also commonly used on smaller portable devices with limited screen size. It may also be used within tables or header components.
The label property provides a tooltip, and can be used for explaining what the button is.
Circle buttons in Vega have the following states:
There are two variants for circle buttons in Vega:
Primary circle buttons are often used for navigation purposes. Secondary variants are used for less important actions.
Name | Description | Default |
---|---|---|
variant | The component itself contains two variants: primary and secondary. The primary variant should be used for buttons which are the main selection option for a form (or CTA), while the secondary should be used for alternate options. primary ,secondary ,icon-only |
primary |
size | Buttons have four sizes: default, small, extra-small, and large, and should be chosen to fit the context of the specific form. Optional | default |
icon | The vega-button can optionally be associated with an icon, which may be chosen from a list of icon design tokens or by using a Font Awesome class. Optional | |
label | This designates the text which will be displayed on the button. Required | |
disabled | This will render the button to be greyed out and will appear to be disabled. Note: it is not recommended to use this attribute, as it may cause usability and accessibility issues. | false |
danger | Danger buttons may be used for destructive actions or actions that could cause unwanted results. boolean | false |
icon-color | Changes the color of the button circle. Will only work if the variant is set to icon-only . Use an existing color token. |
text-primary |
<vega-button-circle
variant='primary|secondary|icon-only'
size='default|small|large'
icon='e.g. cart'
label='aria-label'
disabled=true|false
danger=true|false
icon-color='any color token'
>
</vega-button-circle>
When a vega-button-circle
is clicked, the vegaClick
event is dispatched.
document.getElementById("button_id").addEventListener("vegaClick", (e) => { console.log(e) })
For more details, view in Storybook.
Do
Don’t