Icon button

Action Button

Interactive Demo

settings

Properties

NameTypeDefaultDescription
size'xsmall' | 'small' | 'medium' | 'large' | 'xlarge''small'The size of the icon button.
variant'filled' | 'tonal' | 'outlined' | 'text''text'The visual style variant of the icon button.
width'standard' | 'narrow' | 'wide''standard'The width variant of the icon button.
type'button' | 'submit' | 'reset''button'The button type (inherited from Button).
disabledBooleanfalseWhether the icon button is disabled (inherited from FormAssociated).

Methods

Inherits all standard HTMLElement methods. Use click() to programmatically trigger the button.

Types

settingssettingssettingssettings
<md-icon-button variant="filled"><md-icon>settings</md-icon></md-icon-button>
<md-icon-button variant="tonal"><md-icon>settings</md-icon></md-icon-button>
<md-icon-button variant="outlined"><md-icon>settings</md-icon></md-icon-button>
<md-icon-button variant="text"><md-icon>settings</md-icon></md-icon-button>

Toggle Button

Icon buttons can be used to select between two states.

Interactive Demo

favoritefavorite

Properties

NameTypeDefaultDescription
checkedBooleanfalseWhether the icon button is in the checked state (inherited from Switch).
size'xsmall' | 'small' | 'medium' | 'large' | 'xlarge''small'The size of the icon button toggle.
variant'filled' | 'tonal' | 'outlined' | 'text''text'The visual style variant of the icon button toggle.
width'standard' | 'narrow' | 'wide''standard'The width variant of the icon button toggle.
disabledBooleanfalseWhether the icon button toggle is disabled (inherited from FormAssociated).

Events

NameTypeDescription
changeCustomEvent<boolean>Dispatched when the checked state changes. The detail property contains the new checked state.

Types

favoritefavoritefavoritefavoritefavoritefavoritefavoritefavorite
<md-icon-button-toggle variant="filled">
  <md-icon>favorite</md-icon>
  <md-icon slot="checked" style="font-variation-settings: 'FILL' 1">favorite</md-icon>
</md-icon-button-toggle>
<md-icon-button-toggle variant="tonal">
  <md-icon>favorite</md-icon>
  <md-icon slot="checked" style="font-variation-settings: 'FILL' 1">favorite</md-icon>
</md-icon-button-toggle>
<md-icon-button-toggle variant="outlined">
  <md-icon>favorite</md-icon>
  <md-icon slot="checked" style="font-variation-settings: 'FILL' 1">favorite</md-icon>
</md-icon-button-toggle>
<md-icon-button-toggle variant="text">
  <md-icon>favorite</md-icon>
  <md-icon slot="checked" style="font-variation-settings: 'FILL' 1">favorite</md-icon>
</md-icon-button-toggle>