Icon button
An icon-only button lets people take a common and recognizable action where space is limited.Props
Each button type also supports its respective HTML element attributes, except for:
disabled(useisDisabledinstead)stylerole
| Description | Additional information to be included in the |
|---|---|
| Type | { [x: string]: any; } |
| Description | The button style variation. The button style variation. |
|---|---|
| Type | "default" | "primary" | "subtle" | "rovo" | "discovery" |
| Description | Defines a string value that labels the current element. @see aria-labelledby. |
|---|---|
| Type | never |
| Description | Set the button to autofocus on mount. |
|---|---|
| Type | boolean |
| Description | No description. |
|---|---|
| Type | never |
| Description | Places an icon within the button. |
|---|---|
| Type | ComponentClass<Omit<IconProps, "size"> | Omit<NewIconProps, "size" | "spacing">, any> | FunctionComponent<Omit<IconProps, "size"> | Omit<...>> |
| Description | An optional name used to identify the button to interaction content listeners. By default, button fires React UFO (Unified Frontend Observability) press interactions for available listeners. This helps Atlassian measure performance and reliability. See the pressable or anchor primitive code examples for more information. |
|---|---|
| Type | string |
| Description | Disable the button to prevent user interaction. |
|---|---|
| Type | boolean |
| Description | Conditionally show a spinner over the top of a button |
|---|---|
| Type | boolean |
| Description | Indicates that the button is selected. |
|---|---|
| Type | boolean |
| Description | Prevents a tooltip with the label text from showing. Use sparingly, as most icon-only buttons benefit from a tooltip or some other text clarifying the action. |
|---|---|
| Type | boolean |
| Description | Provide an accessible label, often used by screen readers. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | Handler called on blur. |
|---|---|
| Type | (event: FocusEvent<HTMLButtonElement, Element>) => void |
| Description | Handler called on click. You can use the second argument to fire Atlaskit analytics events on custom channels. They could then be routed to GASv3 analytics. See the pressable or anchor primitive code examples for information on firing Atlaskit analytics events or routing these to GASv3 analytics. |
|---|---|
| Type | (e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Handler called on focus. |
|---|---|
| Type | (event: FocusEvent<HTMLButtonElement, Element>) => void |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLButtonElement) => void) | RefObject<HTMLButtonElement> |
| Description | Set the shape of the icon, defaults to square with rounded corners. |
|---|---|
| Type | "default" | "circle" |
| Description | Controls the amount of padding in the button. |
|---|---|
| Type | "default" | "compact" |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
| Description | Props passed down to the Tooltip component. |
|---|---|
| Type | { content?: ReactNode | (({ update }: { update?: () => void; }) => ReactNode); testId?: string; component?: ComponentType<TooltipPrimitiveProps> | ForwardRefExoticComponent<...>; ... 16 more ...; shouldRenderToParent?: boolean; } |