The icon button is used to trigger a secondary action when we want to reduced visual noise.
This component is deprecated! Please use the new Button instead.
<tk-icon-button
size="medium"
status="ready"
type="contained"
variant="standard"
round="false"
>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
The icon you wish to use as a button is slotted inside of tk-icon-button
.
<tk-icon-button size="xs">
<tk-icon size="xs" name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button size="small">
<tk-icon size="small" name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button size="compact">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button size="medium">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button size="large">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the size
prop to control the size of the button. medium
is the default.
<tk-icon-button>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="outline">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the type
prop to control the type of button. contained
is the default.
<tk-icon-button variant="standard">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button variant="destructive">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the variant
prop to control the variant of the button. standard
is the default.
<tk-icon-button status="disabled">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="disabled" type="outline">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="disabled" type="ghost">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="disabled" variant="destructive">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the status
prop to indicate whether it’s ready, active, or disabled. The default is ready.
<tk-icon-button status="active">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="active" type="outline">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="active" type="ghost">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button status="active" variant="destructive">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the status
prop to indicate whether it’s ready, active, or disabled. The default is ready.
<tk-icon-button round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button variant="destructive" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
Pass the round
boolean prop to render a round button.
<div style="display: flex; background: var(--neutral-grey-800); padding: var(--s-50);">
<tk-icon-button type="ghost" color="neutral">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="neutral" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
</div>
<hr class="horizontal-rule">
<div style="display: flex;">
<tk-icon-button type="ghost" color="blue">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="green">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="yellow">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="red">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="aqua">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="teal">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="orange">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="pink">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="purple">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="grey">
<tk-icon name="close"></tk-icon>
</tk-icon-button>
</div>
<hr class="horizontal-rule">
<div style="display: flex;">
<tk-icon-button type="ghost" color="blue" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="green" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="yellow" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="red" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="aqua" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="teal" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="orange" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="pink" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="purple" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
<tk-icon-button type="ghost" color="grey" round>
<tk-icon name="close"></tk-icon>
</tk-icon-button>
</div>
Pass the round
boolean prop to render a round button.