Icon Button
Initiates an action, such as completing a task or submitting information. Renders one icon and nothing else, with a required label prop that carries the accessible name.
Every IconButton states what it means: appearance (visual weight) and intent (tone) are required; there are no implicit defaults. intent takes "neutral" alone: an icon carries no text to name the action a tone colors, so IconButton draws no accent or danger tone.
Appearance
IconButton draws all three of Button's box appearances, and each one matches its Button twin. link stays off the union — an icon-only link has no text to read as a link. An icon button sits beside a button with no color or weight seam.
Size
Use the size prop to control the box size of the icon button, default md. The scale is shared with Button and SplitButton: the same size name always renders the same box height, so mixed compositions stay aligned.
2xs is for IconButton only. It renders a 20px box and shrinks the icon to 16px, so the button fits inside a line of text, such as a copy button beside a value in a Description List row. The other sizes scale only the box.
Size 2xs
Size xs
Size sm
Size md
Size lg
Size xl
Disabled
Type
Like Button, IconButton defaults to type="button" rather than the native submit, so it never accidentally submits a surrounding <form>. Opt in with type="submit" (or type="reset") when the button should submit or reset a form. When asChild is used, type has no effect and is not forwarded to the child.
isLoading
isLoading determines whether the icon button is in a loading state, default false. Setting isLoading replaces the icon with a spinner. It also disables user interaction with the button and sets aria-disabled.
idle
isLoading
Polymorphism
To render something else as an IconButton, use the asChild prop to compose. This is useful when you want to splat the IconButton styling onto a react-router Link. When you use asChild, the IconButton does NOT pass its type prop to the child component.
A disabled or loading IconButton under asChild gets no disabled attribute, because the attribute is inert on an <a>. The child gets aria-disabled="true", leaves the tab order with tabIndex={-1}, and a click on it is cancelled before any handler or router navigation runs.
API Reference
The IconButton accepts the following props in addition to the standard HTML button attributes.
Data attributes
The IconButton also exposes the following CSS variables as part of its API.