IconButton API

API reference docs for theIconButtoncomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropTypeDescriptionDefault
variant?'accentPrimary' | 'accentSecondary'| 'criticalPrimary'| 'criticalTertiary'| 'neutralPrimary'| 'neutralSecondary'| 'neutralSecondaryIntense'| 'neutralTertiary'Variant of the button.'accentPrimary'
size?'large' | 'standard' | 'small'Size of the button.'standard'
iconIconSet the Icon for the button._
loadingLabel?IconText to read out to assistive technologies when button is loading_
isDisabled?booleanIf true, the button is disabled.false
isLoading?booleanIf true ,the button will display a loading indicator.false
isPressed?booleanIf true, the button will be visually styled as pressed and the aria-pressed attribute will be set accordingly._
type?'button' | 'submit' | 'reset'Specifies the button type.button
id?stringSpecifies a unique id for the button._
aria-labelstringDescribes the component to assistive tech users and the action or effect that will take place when the button is clicked._
aria-controls?stringIdentifies the element (or elements) that the button controls._
aria-expanded?booleanIndicates whether the button, or another element that it controls, is currently expanded or collapsed.false
aria-haspopup?boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'Indicates the availability and type of interactive popup element, such as menu or dialog, triggered by the button._
onClick?functionFunction to call when the button is clicked._