IconButton
Props
API reference for IconButton. For usage examples, see the React tab.
IconButton
| Name | Type | Default |
|---|---|---|
| children* (required) | ReactElement<unknown, string | JSXElementConstructor<any>> | — |
The content of the icon button. | ||
| isDisabled | boolean | — |
Whether the button is disabled. | ||
| isPending | boolean | — |
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. | ||
| size | "lg" | "md" | "sm" | "xs" | xs |
Determines the size of the IconButton. | ||
| variant | "destructive" | "primary" | "secondary" | "tertiary" | tertiary |
Variant for the icon button. | ||
| Name | Type | Default |
|---|---|---|
| aria-controls | string | — |
Identifies the element (or elements) whose contents or presence are controlled by the current element. | ||
| aria-current | "date" | "false" | "location" | "page" | "step" | "time" | "true" | boolean | — |
Indicates whether this element represents the current item within a container or set of related elements. | ||
| aria-describedby | string | — |
Identifies the element (or elements) that describes the object. | ||
| aria-details | string | — |
Identifies the element (or elements) that provide a detailed, extended description for the object. | ||
| aria-disabled | "false" | "true" | boolean | — |
Indicates whether the element is disabled to users of assistive technology. | ||
| aria-expanded | "false" | "true" | boolean | — |
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. | ||
| aria-haspopup | "dialog" | "false" | "grid" | "listbox" | "menu" | "tree" | "true" | boolean | — |
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. | ||
| aria-label | string | — |
Defines a string value that labels the current element. | ||
| aria-labelledby | string | — |
Identifies the element (or elements) that labels the current element. | ||
| aria-pressed | "false" | "mixed" | "true" | boolean | — |
Indicates the current "pressed" state of toggle buttons. | ||
| id | string | — |
The element's unique identifier. See MDN (opens in new tab). | ||
| Name | Type | Default |
|---|---|---|
| autoFocus | boolean | — |
Whether the element should receive focus on render. | ||
| dir | string | — |
| excludeFromTabOrder | boolean | — |
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. | ||
| hidden | boolean | — |
| inert | boolean | — |
| lang | string | — |
| preventFocusOnPress | boolean | — |
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. | ||
| ref | Ref<HTMLButtonElement> | — |
Requires React 19 | ||
| render | DOMRenderFunction<"button", ButtonRenderProps> | — |
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:
| ||
| slot | string | null | — |
A slot name for the component. Slots allow the component to receive props from a parent component. An explicit | ||
| suppressHydrationWarning | boolean | — |
A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs (opens in new tab). | ||
| translate | "no" | "yes" | — |
| Name | Type | Default |
|---|---|---|
| onAnimationEnd | AnimationEventHandler<HTMLButtonElement> | — |
| onAnimationEndCapture | AnimationEventHandler<HTMLButtonElement> | — |
| onAnimationIteration | AnimationEventHandler<HTMLButtonElement> | — |
| onAnimationIterationCapture | AnimationEventHandler<HTMLButtonElement> | — |
| onAnimationStart | AnimationEventHandler<HTMLButtonElement> | — |
| onAnimationStartCapture | AnimationEventHandler<HTMLButtonElement> | — |
| onAuxClick | MouseEventHandler<HTMLButtonElement> | — |
| onAuxClickCapture | MouseEventHandler<HTMLButtonElement> | — |
| onBlur | ((e: FocusEvent<Element, Element>) => void) | — |
Handler that is called when the element loses focus. | ||
| onClickCapture | MouseEventHandler<HTMLButtonElement> | — |
| onContextMenu | MouseEventHandler<HTMLButtonElement> | — |
| onContextMenuCapture | MouseEventHandler<HTMLButtonElement> | — |
| onDoubleClick | MouseEventHandler<HTMLButtonElement> | — |
| onDoubleClickCapture | MouseEventHandler<HTMLButtonElement> | — |
| onFocus | ((e: FocusEvent<Element, Element>) => void) | — |
Handler that is called when the element receives focus. | ||
| onFocusChange | ((isFocused: boolean) => void) | — |
Handler that is called when the element's focus status changes. | ||
| onGotPointerCapture | PointerEventHandler<HTMLButtonElement> | — |
| onGotPointerCaptureCapture | PointerEventHandler<HTMLButtonElement> | — |
| onHoverChange | ((isHovering: boolean) => void) | — |
Handler that is called when the hover state changes. | ||
| onHoverEnd | ((e: HoverEvent) => void) | — |
Handler that is called when a hover interaction ends. | ||
| onHoverStart | ((e: HoverEvent) => void) | — |
Handler that is called when a hover interaction starts. | ||
| onKeyDown | ((e: KeyboardEvent) => void) | — |
Handler that is called when a key is pressed. | ||
| onKeyUp | ((e: KeyboardEvent) => void) | — |
Handler that is called when a key is released. | ||
| onLostPointerCapture | PointerEventHandler<HTMLButtonElement> | — |
| onLostPointerCaptureCapture | PointerEventHandler<HTMLButtonElement> | — |
| onMouseDown | MouseEventHandler<HTMLButtonElement> | — |
| onMouseDownCapture | MouseEventHandler<HTMLButtonElement> | — |
| onMouseEnter | MouseEventHandler<HTMLButtonElement> | — |
| onMouseLeave | MouseEventHandler<HTMLButtonElement> | — |
| onMouseMove | MouseEventHandler<HTMLButtonElement> | — |
| onMouseMoveCapture | MouseEventHandler<HTMLButtonElement> | — |
| onMouseOut | MouseEventHandler<HTMLButtonElement> | — |
| onMouseOutCapture | MouseEventHandler<HTMLButtonElement> | — |
| onMouseOver | MouseEventHandler<HTMLButtonElement> | — |
| onMouseOverCapture | MouseEventHandler<HTMLButtonElement> | — |
| onMouseUp | MouseEventHandler<HTMLButtonElement> | — |
| onMouseUpCapture | MouseEventHandler<HTMLButtonElement> | — |
| onPointerCancel | PointerEventHandler<HTMLButtonElement> | — |
| onPointerCancelCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPointerDown | PointerEventHandler<HTMLButtonElement> | — |
| onPointerDownCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPointerEnter | PointerEventHandler<HTMLButtonElement> | — |
| onPointerLeave | PointerEventHandler<HTMLButtonElement> | — |
| onPointerMove | PointerEventHandler<HTMLButtonElement> | — |
| onPointerMoveCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPointerOut | PointerEventHandler<HTMLButtonElement> | — |
| onPointerOutCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPointerOver | PointerEventHandler<HTMLButtonElement> | — |
| onPointerOverCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPointerUp | PointerEventHandler<HTMLButtonElement> | — |
| onPointerUpCapture | PointerEventHandler<HTMLButtonElement> | — |
| onPress | ((e: PressEvent) => void) | — |
Handler that is called when the press is released over the target. | ||
| onPressChange | ((isPressed: boolean) => void) | — |
Handler that is called when the press state changes. | ||
| onPressEnd | ((e: PressEvent) => void) | — |
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. | ||
| onPressStart | ((e: PressEvent) => void) | — |
Handler that is called when a press interaction starts. | ||
| onPressUp | ((e: PressEvent) => void) | — |
Handler that is called when a press is released over the target, regardless of whether it started on the target or not. | ||
| onScroll | UIEventHandler<HTMLButtonElement> | — |
| onScrollCapture | UIEventHandler<HTMLButtonElement> | — |
| onTouchCancel | TouchEventHandler<HTMLButtonElement> | — |
| onTouchCancelCapture | TouchEventHandler<HTMLButtonElement> | — |
| onTouchEnd | TouchEventHandler<HTMLButtonElement> | — |
| onTouchEndCapture | TouchEventHandler<HTMLButtonElement> | — |
| onTouchMove | TouchEventHandler<HTMLButtonElement> | — |
| onTouchMoveCapture | TouchEventHandler<HTMLButtonElement> | — |
| onTouchStart | TouchEventHandler<HTMLButtonElement> | — |
| onTouchStartCapture | TouchEventHandler<HTMLButtonElement> | — |
| onTransitionCancel | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionCancelCapture | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionEnd | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionEndCapture | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionRun | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionRunCapture | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionStart | TransitionEventHandler<HTMLButtonElement> | — |
| onTransitionStartCapture | TransitionEventHandler<HTMLButtonElement> | — |
| onWheel | WheelEventHandler<HTMLButtonElement> | — |
| onWheelCapture | WheelEventHandler<HTMLButtonElement> | — |
| Name | Type | Default |
|---|---|---|
| form | string | — |
The | ||
| formAction | string | ((formData: FormData) => void | Promise<void>) | — |
The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner. | ||
| formEncType | string | — |
Indicates how to encode the form data that is submitted. | ||
| formMethod | string | — |
Indicates the HTTP method used to submit the form. | ||
| formNoValidate | boolean | — |
Indicates that the form is not to be validated when it is submitted. | ||
| formTarget | string | — |
Overrides the target attribute of the button's form owner. | ||
| name | string | — |
Submitted as a pair with the button's value as part of the form data. | ||
| type | "button" | "reset" | "submit" | 'button' |
The behavior of the button when used in an HTML form. | ||
| value | string | — |
The value associated with the button's name when it's submitted with the form data. | ||
| Name | Type | Default |
|---|---|---|
| className | ClassNameOrFunction<ButtonRenderProps> | 'react-aria-Button' |
The CSS className (opens in new tab) for the element. A function may be provided to compute the class based on component state. | ||
| style | StyleOrFunction<ButtonRenderProps> | — |
The inline style (opens in new tab) for the element. A function may be provided to compute the style based on component state. | ||
LinkIconButton
| Name | Type | Default |
|---|---|---|
| children* (required) | ReactElement<unknown, string | JSXElementConstructor<any>> | — |
The content of the icon button. | ||
| download | string | boolean | — |
Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN (opens in new tab). | ||
| href | string | — |
A URL to link to. See MDN (opens in new tab). | ||
| hrefLang | string | — |
Hints at the human language of the linked URL. SeeMDN (opens in new tab). | ||
| inline | boolean | null | — |
| isDisabled | boolean | — |
Whether the link is disabled. | ||
| ping | string | — |
A space-separated list of URLs to ping when the link is followed. See MDN (opens in new tab). | ||
| referrerPolicy | HTMLAttributeReferrerPolicy | — |
How much of the referrer to send when following the link. See MDN (opens in new tab). | ||
| rel | string | — |
The relationship between the linked resource and the current page. See MDN (opens in new tab). | ||
| routerOptions | undefined | — |
Options for the configured client side router. | ||
| size | "lg" | "md" | "sm" | "xs" | xs |
Determines the size of the LinkIconButton. | ||
| target | HTMLAttributeAnchorTarget | — |
The target window for the link. See MDN (opens in new tab). | ||
| variant | "destructive" | "primary" | "secondary" | "tertiary" | tertiary |
Variant for the icon button. | ||
| Name | Type | Default |
|---|---|---|
| aria-current | "date" | "false" | "location" | "page" | "step" | "time" | "true" | boolean | — |
Indicates whether this element represents the current item within a container or set of related elements. | ||
| aria-describedby | string | — |
Identifies the element (or elements) that describes the object. | ||
| aria-details | string | — |
Identifies the element (or elements) that provide a detailed, extended description for the object. | ||
| aria-label | string | — |
Defines a string value that labels the current element. | ||
| aria-labelledby | string | — |
Identifies the element (or elements) that labels the current element. | ||
| id | string | — |
The element's unique identifier. See MDN (opens in new tab). | ||
| Name | Type | Default |
|---|---|---|
| autoFocus | boolean | — |
Whether the element should receive focus on render. | ||
| dir | string | — |
| hidden | boolean | — |
| inert | boolean | — |
| lang | string | — |
| render | ((props: DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement>, renderProps: LinkRenderProps) => ReactElement<...>) | — |
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. Note: You can check if Requirements:
| ||
| slot | string | null | — |
A slot name for the component. Slots allow the component to receive props from a parent component. An explicit | ||
| suppressHydrationWarning | boolean | — |
A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs (opens in new tab). | ||
| translate | "no" | "yes" | — |
| Name | Type | Default |
|---|---|---|
| onAnimationEnd | AnimationEventHandler<HTMLAnchorElement> | — |
| onAnimationEndCapture | AnimationEventHandler<HTMLAnchorElement> | — |
| onAnimationIteration | AnimationEventHandler<HTMLAnchorElement> | — |
| onAnimationIterationCapture | AnimationEventHandler<HTMLAnchorElement> | — |
| onAnimationStart | AnimationEventHandler<HTMLAnchorElement> | — |
| onAnimationStartCapture | AnimationEventHandler<HTMLAnchorElement> | — |
| onAuxClick | MouseEventHandler<HTMLAnchorElement> | — |
| onAuxClickCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onBlur | ((e: FocusEvent<Element, Element>) => void) | — |
Handler that is called when the element loses focus. | ||
| onClickCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onContextMenu | MouseEventHandler<HTMLAnchorElement> | — |
| onContextMenuCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onDoubleClick | MouseEventHandler<HTMLAnchorElement> | — |
| onDoubleClickCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onFocus | ((e: FocusEvent<Element, Element>) => void) | — |
Handler that is called when the element receives focus. | ||
| onFocusChange | ((isFocused: boolean) => void) | — |
Handler that is called when the element's focus status changes. | ||
| onGotPointerCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onGotPointerCaptureCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onHoverChange | ((isHovering: boolean) => void) | — |
Handler that is called when the hover state changes. | ||
| onHoverEnd | ((e: HoverEvent) => void) | — |
Handler that is called when a hover interaction ends. | ||
| onHoverStart | ((e: HoverEvent) => void) | — |
Handler that is called when a hover interaction starts. | ||
| onKeyDown | ((e: KeyboardEvent) => void) | — |
Handler that is called when a key is pressed. | ||
| onKeyUp | ((e: KeyboardEvent) => void) | — |
Handler that is called when a key is released. | ||
| onLostPointerCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onLostPointerCaptureCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onMouseDown | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseDownCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseEnter | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseLeave | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseMove | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseMoveCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseOut | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseOutCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseOver | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseOverCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseUp | MouseEventHandler<HTMLAnchorElement> | — |
| onMouseUpCapture | MouseEventHandler<HTMLAnchorElement> | — |
| onPointerCancel | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerCancelCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerDown | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerDownCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerEnter | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerLeave | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerMove | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerMoveCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerOut | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerOutCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerOver | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerOverCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerUp | PointerEventHandler<HTMLAnchorElement> | — |
| onPointerUpCapture | PointerEventHandler<HTMLAnchorElement> | — |
| onPress | ((e: PressEvent) => void) | — |
Handler that is called when the press is released over the target. | ||
| onPressChange | ((isPressed: boolean) => void) | — |
Handler that is called when the press state changes. | ||
| onPressEnd | ((e: PressEvent) => void) | — |
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. | ||
| onPressStart | ((e: PressEvent) => void) | — |
Handler that is called when a press interaction starts. | ||
| onPressUp | ((e: PressEvent) => void) | — |
Handler that is called when a press is released over the target, regardless of whether it started on the target or not. | ||
| onScroll | UIEventHandler<HTMLAnchorElement> | — |
| onScrollCapture | UIEventHandler<HTMLAnchorElement> | — |
| onTouchCancel | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchCancelCapture | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchEnd | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchEndCapture | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchMove | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchMoveCapture | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchStart | TouchEventHandler<HTMLAnchorElement> | — |
| onTouchStartCapture | TouchEventHandler<HTMLAnchorElement> | — |
| onTransitionCancel | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionCancelCapture | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionEnd | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionEndCapture | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionRun | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionRunCapture | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionStart | TransitionEventHandler<HTMLAnchorElement> | — |
| onTransitionStartCapture | TransitionEventHandler<HTMLAnchorElement> | — |
| onWheel | WheelEventHandler<HTMLAnchorElement> | — |
| onWheelCapture | WheelEventHandler<HTMLAnchorElement> | — |
| Name | Type | Default |
|---|---|---|
| className | ClassNameOrFunction<LinkRenderProps> | 'react-aria-Link' |
The CSS className (opens in new tab) for the element. A function may be provided to compute the class based on component state. | ||
| style | StyleOrFunction<LinkRenderProps> | — |
The inline style (opens in new tab) for the element. A function may be provided to compute the style based on component state. | ||