---
title: TonalButton
description: TonalButton API.
---

import CodeSnippetMD from '@slint/common-files/src/components/CodeSnippetMD.astro';
import SlintProperty from '@slint/common-files/src/components/SlintProperty.astro';

<CodeSnippetMD imagePath="/src/assets/generated/tonalbutton.png" scale="3" imageWidth="300" imageHeight="200" imageAlt="">
```slint
import { TonalButton } from "@material";
export component Example inherits Window {
    width: 200px;
    height: 100px;
    background: transparent;
    TonalButton {
        text: "Tonal";
        icon: @image-url("../icons/music_note.svg");
        width: 120px;
        height: 40px;
    }
}
```
</CodeSnippetMD>

A `TonalButton` is a button with a secondary container background, used for less prominent actions than filled or elevated buttons.

## Properties

### enabled
<SlintProperty propName="enabled" typeName="bool" defaultValue="true">
Whether the button is enabled and can be interacted with.
</SlintProperty>

### icon
<SlintProperty propName="icon" typeName="image">
An optional icon displayed on the button.
</SlintProperty>

### text
<SlintProperty propName="text" typeName="string">
The text label displayed on the button.
</SlintProperty>

### tooltip
<SlintProperty propName="tooltip" typeName="string">
A tooltip text that appears when hovering over the button.
</SlintProperty>

## Callbacks

### clicked()
Invoked when the button is clicked.
