Skip to content

IconButton

Stable

A round button that shows only an icon. It always has a name, and it can show an on or off state.

Also known as icon only button, action icon

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Variants and sizes

Ghost is the default for message toolbars. There are medium and small sizes.

When to use it

A small round button for actions people know by their icon, such as copy, send or stop. There are no words on it, so it always takes a name that screen readers read and a mouse shows as a tooltip.

Made of: Icon

Use it for

  • Toolbar actions under a reply, like copy and regenerate.
  • The send and stop buttons in a message box.
  • An on-or-off action, like marking a reply as good: set active.

Not for

  • An action whose icon people may not recognise: use Button.
  • A setting that stays on until someone turns it off: use Switch.

Do and avoid

Do. Copy and share icons are known, and each has a name.
Avoid. Unclear icons leave people guessing what a press will do.

Do

  • Always give it a label that names the action, like "Copy" or "Stop generating".
  • Use lime for the send button and primary for stop.
  • Use active for real on-or-off buttons, and keep the label the same when the state changes.
  • Use a slightly smaller icon in the small size.

Avoid

  • Do not use IconButton when the icon is unclear. Use a Button with text.
  • Do not use active to mark the page someone is on.
  • Do not put text inside. The button is a fixed square.
  • Do not make it amber. Amber is only for when a person has to act.

On a phone

  • On a touch screen the button keeps its size and has a tap area at least 44px tall and wide, even at size sm.
  • The name only shows as a hover tooltip, which a phone never shows, so the icon must be clear without it.
  • Leave room between neighbouring icon buttons. Each tap area is 44px wide, so buttons packed close together share the space between them.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started