---
title: "Button | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/ui-framework/widgets/button/"
---

# Button

> A widget that adds a button. You may call some code by clicking it.

![Button widget.](images/button.png)

## General info

- **type**: `button`

## Params

- `classStyle` - `'primary'` | `'success'` (a button style).
- `text` - the button caption.
- `icon` - ID of an SVG icon defined in the UI theme.
- `image` - URL to the button image.
- `enabled ` - `true` | `false` - whether a button is clickable.
- `visible ` - `true` | `false` - whether a button is visible.
- `onClick ` - a single function or an array of functions (described as `{{#function ...}}` - see [Dynamic Configs article](https://customerscanvas.com/docs/on-premises/ui-framework/writing-configs/dynamic-expressions.md) for details). 

## Example

```json
{
  "name": "button-fin",
  "type": "button",
  "params": {
    "text": "Click me",
    "classStyle": "primary",
    "onClick": "{{#function console.log('Hello world');}}",
    "enabled": true,
    "visible": true
  }
}
```
