Usage
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 button.
xs
sm
md
lg
Variants
Use the variant prop to change its visual style
solid
subtle
surface
outline
ghost
Color
Use the colorPalette prop to change the color of the button
Rounded
Set rounded="full" to make the button fully rounded
Props
| Prop | Default | Type |
|---|---|---|
spinnerPlacement | start | 'start' | 'end' | undefinedThe placement of the spinner |
colorPalette | gray | 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink'The color palette of the component |
size | md | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'The size of the component |
variant | solid | 'solid' | 'subtle' | 'surface' | 'outline' | 'ghost' | 'plain'The variant of the component |
spinner | React.ReactNode | undefinedThe spinner to show while loading. | |
as | React.ElementTypeThe underlying element to render. | |
asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. For more details, read our Composition guide. |