Skip to main content

IconButton

import { IconButton } from '@tulsa/core';

<IconButton variant={"Primary"} icon={<BiSearch size={"1em"} color="inherit" />} />
<IconButton variant={"Secondary"} icon={<BiSearch size={"1em"} color="inherit" />} />
<IconButton variant={"Invisible"} icon={<BiSearch size={"1em"} color="inherit" />} />

Props

NameTypeDescriptionDefault
icon*React.ReactElementControls the icon that is displayed. Must be a React Element.
size'xs' | 'sm' | 'lg'Controls the relative size of the button"sm"
circlebooleanIf true, makes the IconButton appear as a circle as opposed to a rounded square.
variant'Primary' | 'Secondary' | 'Invisible'Controls the look & feel of the button'Primary'
asTControls the root element that is used by the button. Can be an HTML element string or a React component."button"
selectedbooleanSets whether or not the button is displayed as selected or not. Particularly useful in a `ButtonGroup`

Native props are forwarded to the root component.

Examples

Circle

<IconButton circle icon={<BiSearch size={"1em"} color="inherit" />} />

Sizes

<IconButton size={"xs"} icon={<BiSearch size={"1em"} color="inherit" />} />
<IconButton size={"sm"} icon={<BiSearch size={"1em"} color="inherit" />} />
<IconButton size={"lg"} icon={<BiSearch size={"1em"} color="inherit" />} />