--- title: CloseButton description: "`CloseButton`は、基本的にコンポーネントの閉じる機能をトリガーするために使用するコンポーネントです。" 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 ``` ## 使い方 ```tsx import { CloseButton } from "@yamada-ui/react" ``` ```tsx import { CloseButton } from "@/components/ui" ``` ```tsx import { CloseButton } from "@workspaces/ui" ``` ```tsx ``` ### バリアントを変更する ```tsx {(variant, index) => } ``` ### サイズを変更する ```tsx {(size, index) => } ``` ### カラースキームを変更する ```tsx {(colorScheme, index) => ( )} ``` ### 形を変える 角丸にする場合は、`fullRounded`を`true`にします。 ```tsx {(variant, index) => ( )} ``` ### 無効にする 無効にする場合は、`disabled`を`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`. | ## アクセシビリティ 現在、v2の移行に伴い、このセクションは更新中です。