Icon button
Material 3 icon-button guidance, action/toggle semantics, variants, expressive sizing, and accessibility.
Icon buttons provide compact actions where a familiar icon can communicate the action without a persistent text label. Material 3 separates ordinary action icon buttons from persistent toggle icon buttons; m3-ui preserves that semantic split in separate public components.
import { IconButton } from '@m3-ui/ui';
<IconButton aria-label="Add item" onPress={addItem}>
<AddIcon />
</IconButton>When to use
Use an icon button when the icon is conventional in context and the action needs a compact target. Prefer a labeled Button when the icon would be ambiguous or when action hierarchy depends on visible text.
Use toggle icon buttons only for persistent selected/pressed state such as favorite, mute, or pin. Do not use toggle state merely to style an action after it was pressed.
Variants
| Material family | Action | Toggle |
|---|---|---|
| Standard | IconButton | IconToggleButton |
| Filled | FilledIconButton | FilledIconToggleButton |
| Filled tonal | FilledTonalIconButton | FilledTonalIconToggleButton |
| Outlined | OutlinedIconButton | OutlinedIconToggleButton |
The visual family communicates hierarchy while action vs toggle determines semantics.
Toggle behavior
Toggle variants expose controlled selected state:
<FilledTonalIconToggleButton
aria-label="Favorite"
isSelected={favorite}
onChange={setFavorite}
>
<FavoriteIcon />
</FilledTonalIconToggleButton>React Aria ToggleButton supplies the pressed/selected interaction contract. Material tokens control selected and unselected visual treatment.
Size, width, and shape
The audited expressive API uses named Material options rather than copied dimensions:
size:extraSmall,small,medium,large,extraLarge;width:narrow,default,wide;shape:round,square.
<OutlinedIconButton
aria-label="Open menu"
size="large"
width="wide"
shape="round"
>
<MenuIcon />
</OutlinedIconButton>Optional expressive shapes mappings can customize normal/pressed Material shape transitions. Omitting them keeps the standard audited shape path.
Behavior and states
React Aria owns action/toggle semantics, keyboard and pointer activation, disabled state, hover, and focus visibility. The shared Material ripple and token layers own state indication, container geometry, color, shape, and motion.
The icon child is presentation-only. The button remains the sole interaction and accessible-name owner.
Accessibility
Icon-only controls need an explicit accessible name such as aria-label="Add item". Do not rely on the SVG's title: the icon container is intentionally hidden from the accessibility tree so the control exposes one stable name.
For toggle icon buttons, name the action or property consistently while pressed state communicates selection. Avoid changing the accessible name between unrelated verbs in a way that makes the control's identity unstable.
API reference
IconButton
IconButton(props: IconButtonProps): JSX.ElementProps
| Name | Type | Default | Description | Origin |
|---|---|---|---|---|
children* | ReactNode | — | — | @m3-ui/ui |
shape | IconButtonShape | undefined | — | — | @m3-ui/ui |
shapes | IconButtonShapes | undefined | — | — | @m3-ui/ui |
size | IconButtonSize | undefined | — | — | @m3-ui/ui |
style | StyleOrFunction<ButtonRenderProps> | undefined | — | — | @m3-ui/ui |
width | IconButtonWidth | undefined | — | — | @m3-ui/ui |
Inherited React / web props (110)
| Name | Type | Default | Description | Origin |
|---|---|---|---|---|
aria-controls | string | undefined | — | Identifies the element (or elements) whose contents or presence are controlled by the current element. | react-aria |
aria-current | boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined | — | Indicates whether this element represents the current item within a container or set of related elements. | react-aria |
aria-describedby | string | undefined | — | Identifies the element (or elements) that describes the object. | @react-types/shared |
aria-details | string | undefined | — | Identifies the element (or elements) that provide a detailed, extended description for the object. | @react-types/shared |
aria-disabled | boolean | "true" | "false" | undefined | — | Indicates whether the element is disabled to users of assistive technology. | react-aria |
aria-expanded | boolean | "true" | "false" | undefined | — | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. | react-aria |
aria-haspopup | boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined | — | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. | react-aria |
aria-label | string | undefined | — | Defines a string value that labels the current element. | @react-types/shared |
aria-labelledby | string | undefined | — | Identifies the element (or elements) that labels the current element. | @react-types/shared |
aria-pressed | boolean | "true" | "false" | "mixed" | undefined | — | Indicates the current "pressed" state of toggle buttons. | react-aria |
autoFocus | boolean | undefined | — | Whether the element should receive focus on render. | @react-types/shared |
className | ClassNameOrFunction<ButtonRenderProps> | undefined | 'react-aria-Button' | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. | react-aria-components |
dir | string | undefined | — | — | @react-types/shared |
excludeFromTabOrder | boolean | undefined | — | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. | @react-types/shared |
form | string | undefined | — | The `<form>` element to associate the button with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form). | react-aria |
formAction | string | ((formData: FormData) => void | Promise<void>) | undefined | — | The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner. | react-aria |
formEncType | string | undefined | — | Indicates how to encode the form data that is submitted. | react-aria |
formMethod | string | undefined | — | Indicates the HTTP method used to submit the form. | react-aria |
formNoValidate | boolean | undefined | — | Indicates that the form is not to be validated when it is submitted. | react-aria |
formTarget | string | undefined | — | Overrides the target attribute of the button's form owner. | react-aria |
hidden | boolean | undefined | — | — | @react-types/shared |
id | string | undefined | — | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). | @react-types/shared |
inert | boolean | undefined | — | — | @react-types/shared |
isDisabled | boolean | undefined | — | Whether the button is disabled. | react-aria |
isPending | boolean | undefined | — | Whether the button is in a pending state. This disables press and hover events while retaining focusability, and announces the pending state to screen readers. | react-aria-components |
lang | string | undefined | — | — | @react-types/shared |
name | string | undefined | — | Submitted as a pair with the button's value as part of the form data. | react-aria |
onAnimationEnd | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAnimationEndCapture | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAnimationIteration | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAnimationIterationCapture | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAnimationStart | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAnimationStartCapture | AnimationEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAuxClick | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onAuxClickCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onBlur | ((e: FocusEvent<Element, Element>) => void) | undefined | — | Handler that is called when the element loses focus. | @react-types/shared |
onClick | ((e: MouseEvent<FocusableElement>) => void) | undefined | — | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. | @react-types/shared |
onClickCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onContextMenu | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onContextMenuCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onDoubleClick | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onDoubleClickCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onFocus | ((e: FocusEvent<Element, Element>) => void) | undefined | — | Handler that is called when the element receives focus. | @react-types/shared |
onFocusChange | ((isFocused: boolean) => void) | undefined | — | Handler that is called when the element's focus status changes. | @react-types/shared |
onGotPointerCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onGotPointerCaptureCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onHoverChange | ((isHovering: boolean) => void) | undefined | — | Handler that is called when the hover state changes. | @react-types/shared |
onHoverEnd | ((e: HoverEvent) => void) | undefined | — | Handler that is called when a hover interaction ends. | @react-types/shared |
onHoverStart | ((e: HoverEvent) => void) | undefined | — | Handler that is called when a hover interaction starts. | @react-types/shared |
onKeyDown | ((e: KeyboardEvent) => void) | undefined | — | Handler that is called when a key is pressed. | @react-types/shared |
onKeyUp | ((e: KeyboardEvent) => void) | undefined | — | Handler that is called when a key is released. | @react-types/shared |
onLostPointerCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onLostPointerCaptureCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseDown | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseDownCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseEnter | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseLeave | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseMove | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseMoveCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseOut | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseOutCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseOver | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseOverCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseUp | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onMouseUpCapture | MouseEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerCancel | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerCancelCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerDown | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerDownCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerEnter | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerLeave | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerMove | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerMoveCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerOut | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerOutCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerOver | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerOverCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerUp | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPointerUpCapture | PointerEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onPress | ((e: PressEvent) => void) | undefined | — | Handler that is called when the press is released over the target. | @react-types/shared |
onPressChange | ((isPressed: boolean) => void) | undefined | — | Handler that is called when the press state changes. | @react-types/shared |
onPressEnd | ((e: PressEvent) => void) | undefined | — | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. | @react-types/shared |
onPressStart | ((e: PressEvent) => void) | undefined | — | Handler that is called when a press interaction starts. | @react-types/shared |
onPressUp | ((e: PressEvent) => void) | undefined | — | Handler that is called when a press is released over the target, regardless of whether it started on the target or not. | @react-types/shared |
onScroll | UIEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onScrollCapture | UIEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchCancel | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchCancelCapture | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchEnd | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchEndCapture | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchMove | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchMoveCapture | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchStart | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTouchStartCapture | TouchEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionCancel | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionCancelCapture | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionEnd | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionEndCapture | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionRun | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionRunCapture | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionStart | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onTransitionStartCapture | TransitionEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onWheel | WheelEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
onWheelCapture | WheelEventHandler<HTMLButtonElement> | undefined | — | — | @react-types/shared |
preventFocusOnPress | boolean | undefined | — | Whether to prevent focus from moving to the button when pressing it. Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control. | react-aria |
render | DOMRenderFunction<"button", ButtonRenderProps> | undefined | — | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. | react-aria-components |
slot | string | null | undefined | — | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. | react-aria-components |
translate | "yes" | "no" | undefined | — | — | @react-types/shared |
type | "button" | "submit" | "reset" | undefined | 'button' | The behavior of the button when used in an HTML form. | react-aria |
value | string | undefined | — | The value associated with the button's name when it's submitted with the form data. | react-aria |
Source: packages/ui/src/components/IconButton/IconButton.tsx:210
Material fidelity and web adaptation
- Family
- Icon buttons
- Provenance
- spec: Material 3 overview · web: Browser and React Aria semantics · adaptation: m3-ui web adaptation
- Compose mapping
- IconButton · IconToggleButton
- Visual fidelity
- partial: Legacy visual fidelity has not received an explicit reviewed disposition. Current implementation evidence: Implements standard, filled, filled-tonal, and outlined action and toggle icon buttons with the audited extra-small through extra-large size family, narrow/default/wide widths, round/square shapes, state layers, and expressive shape helpers.
- Behavior fidelity
- adapted: React Aria Button and ToggleButton own action/toggle semantics, disabled state, keyboard/pointer behavior, selection, hover, and focus visibility. The icon is visually hidden from accessibility so every icon-only control needs an accessible name on the button itself.
- Semantics fidelity
- adapted: React Aria Button and ToggleButton own action/toggle semantics, disabled state, keyboard/pointer behavior, selection, hover, and focus visibility. The icon is visually hidden from accessibility so every icon-only control needs an accessible name on the button itself.
- Adaptations
- React Aria Button and ToggleButton own action/toggle semantics, disabled state, keyboard/pointer behavior, selection, hover, and focus visibility. The icon is visually hidden from accessibility so every icon-only control needs an accessible name on the button itself.
Material 3 provides the visual families, hierarchy, shape, state, and expressive sizing model. React Aria supplies browser-native button/toggle behavior and aria-pressed semantics where appropriate.
Related components
- Button — labeled actions.
- Toggle button — persistent selection with visible text.
- FAB — prominent floating actions.