--- title: CloseButton description: "`CloseButton` is a component used primarily to trigger the close functionality of a component." links: - style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/close-button/close-button.style.ts - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/close-button - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-closebutton--basic --- ```tsx ``` ## Usage ```tsx import { CloseButton } from "@yamada-ui/react" ``` ```tsx import { CloseButton } from "@/components/ui" ``` ```tsx import { CloseButton } 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 {(variant, index) => ( )} ``` ### Disable To disable, set `disabled` to `true`. ```tsx {(variant, index) => } ``` ## 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` | `"xs"` | `"2xl" \| "2xs" \| "lg" \| "md" \| "sm" \| "xl" \| "xs"` | The size of the component. | | `variant` | `"ghost"` | `"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` | - | `string \| number \| bigint \| boolean \| ReactElement> \| Iterable \| ReactPortal \| Promise<...>` | 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.