Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Icon Button

Used to render an icon within a button

Recipe

Anatomy

import { IconButton } from '@chakra-ui/react'
<IconButton aria-label="Search database">
  <LuSearch />
</IconButton>

Examples

Sizes

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

xs

sm

md

lg

Variants

Use the variant prop to change the visual style of the icon button. You can set the value to solid, subtle, surface, outline or ghost.

solid

subtle

surface

outline

ghost

Color

Use the colorPalette prop to change the color of the icon button.

Rounded

Use the rounded="full" prop to make the icon button fully rounded.

Props

PropDefaultType
colorPalette 'gray'
'gray' | 'zinc' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'presence' | 'status' | 'sidebar' | 'sidebar.accent' | 'accent' | 'slate'

The color palette of the component

size 'md'
'xs' | 'sm' | 'md' | 'lg' | 'xl'

The size of the component

variant 'surface'
'solid' | 'subtle' | 'glass' | 'surface' | 'outline' | 'ghost' | 'plain'

The variant of the component

loading
boolean

loadingText
React.ReactNode