--- title: IconButton description: "`IconButton` is a component that displays an icon within a button." links: - style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/icon-button/icon-button.style.ts - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/icon-button - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-iconbutton--basic --- ```tsx } /> ``` ## Usage ```tsx import { IconButton } from "@yamada-ui/react" ``` ```tsx import { IconButton } from "@/components/ui" ``` ```tsx import { IconButton } from "@workspaces/ui" ``` ```tsx ``` ### Change Variant ```tsx {(variant, index) => ( } /> )} ``` ### Change Size ```tsx {(size, index) => ( } /> )} ``` ### Change Color Scheme ```tsx {(colorScheme, index) => ( } /> )} ``` ### Change Shape To rounded corners, set `fullRounded` to `true`. ```tsx } /> } /> } /> } /> } /> ``` ### Disable To disable, set `disabled` to `true`. ```tsx } /> } /> } /> } /> } /> ``` ## Props | Prop | Default | Type | Description | | --------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"2xl" \| "2xs" \| "lg" \| "md" \| "sm" \| "xl" \| "xs"` | The size of the component. | | `variant` | `"solid"` | `"ghost" \| "outline" \| "solid" \| "subtle" \| "surface" ...` | The variant of the component. | | `active` | `false` | `boolean` | If `true`, the button is represented as active. | | `disabled` | `false` | `boolean` | If `true`, the button is disabled. | | `disableRipple` | `false` | `boolean` | If `true`, disable ripple effects when pressing a element. | | `fullRounded` | `false` | `boolean` | If `true`, the button is full rounded. Else, it'll be slightly round. | | `icon` | - | `ReactNode` | The icon to be used in the button. | | `loading` | `false` | `boolean` | If `true`, the loading state of the button is represented. | | `type` | `"button"` | `"button" \| "reset" \| "submit"` | The type of button. Accepts `button`, `reset`, or `submit`. | ## Accessibility Currently, this section is being updated due to the migration of v2.