Components

Icon Button

IconButton is a button that renders an icon instead of text.

Since it's only an icon that's rendered, it's required to pass the aria-label prop, so that assistive technologies can give meaning to the button.

Import

import { IconButton } from '@outfitio/outkit';

Usage

Button variants

Just like the Button component, use the variant prop to change the visual style of the Button. You can set the value to solid, ghost, outline, or link.

Solid (default)

Outline

Ghost

Button sizes

Use the size prop to change the size of the icon button. You can set the value to sm, md, or lg.

Props

NameTypeDefaultDescription
tooltipstringAs part of our design guidelines, all icon buttons require a tooltip.
tooltipPropsobjectObject of props to apply to the tooltip component
sizesm, md, lgmdSpecifies an explicit icon size instead of the default value.
iconstringnullThe icon to be used. Refer to the Icons section of the docs for the available icon options.
isRoundbooleanfalseIf true, the button will be perfectly round. Else, it'll be slightly round.
aria-label (required)stringA11y: A label that describes the button.
variantoutline, ghost, unstyled , link , solidsolidThe variant of the button style to use.
variantColorstringgrayThe color scheme of the button.
isDisabledbooleanIf true, the button will be disabled.
isLoadingbooleanIf true, the button will show a spinner.