Actions
Icon button
A round button that shows only an icon, used for familiar actions where space is short, such as Search in the app bar or Next day beside a date.
In kanso-ui as IconButton
Variants and sizes
k-iconbtn: plain, no fill, for app bars, rows and toolbars.k-iconbtn--tonal: acontainerfill for a little weight: "Edit payment".k-iconbtn--ink: the strong icon action: "Add something" in a compact bar.k-iconbtn--outline: a 1pxoutlinering: "Previous day", "Next day".k-iconbtn--sm: 32px, for dense web toolbars only.- Toggle: any variant with
aria-pressed.
States
- Hover and pressed: the state layer at
state-hover(8%) andstate-pressed(12%). - Focus: the 2px
focus-ring, 2px outside the circle. - Toggle on,
aria-pressed="true": aninkfill, anon-inkicon, and the icon filled withk-icon--fill. The shape changes from outlined to filled, so the state is not told by colour alone. Toggle off,aria-pressed="false": the variant's rest look with an outlined icon. - Disabled: there is none. When the action cannot run, leave the button out, or use a Button that can say why.
Do and don’t
Do
Name the object: "Edit payment", not "Edit".
Fill the icon only when a toggle is on.
Don’t
Use the small size on phones.
Swap the icon or the name when a toggle flips.
Invent a symbol for an action that has none: write a Button.
What you provide
- Icon name:
search,edit,add,chevron_right,more_vert,notifications. - Accessible name.
- Variant and size.
- The press handler and, for a toggle, the pressed state.
- On the web, the tooltip text: the name.