# ToolbarButton

[TwebToolbarButton](https://github.com/tigriweb/components/blob/master/attributes/TwebToolbarButton.js)

<div align="left" data-full-width="false"><figure><img src="https://870798947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWAokPCWM65E5XQJVixgi%2Fuploads%2FYPgzhIZTWBxZYMzOQ4Z8%2Ftoolbar-button.jpg?alt=media&#x26;token=a9fde9ce-c9bb-4b59-91f8-60abdcf38db0" alt=""><figcaption></figcaption></figure></div>

<details>

<summary>{ label, icon*, name*, onClick, attributes*, setAttributes* }</summary>

```jsx
/**
 * @param {string} [label] - Component label.
 * @param {JSX.Element} icon - Component icon.
 * @param {string} name - Attribute name.
 * @param {function} [onClick] - Function called when the button is clicked.
 * @param {object} attributes - Object containing block attributes.
 * @param {function} setAttributes - Function to set new block attribute values.
 */
```

</details>

{% code title="block.json" overflow="wrap" %}
```json
"isFullScreen": {
	"type": "boolean",
	"default": false
},
```
{% endcode %}

{% code title="index.js" overflow="wrap" %}
```jsx
import {
	TwebSVG,
} from '@tigriweb/components/primitives';

import {
	TwebToolbarButton,
} from '@tigriweb/components/attributes';
```
{% endcode %}

{% code title="index.js | edit()" %}
```jsx
<TwebToolbarButton
	icon={ <TwebSVG icon="arrow-autofit-height" /> }
	label={ __('Toggle full height', 'your-theme-name') }
	name="isFullScreen"
	{ ...{ attributes, setAttributes } }
/>
```
{% endcode %}
