CloseButton

CloseButton is essentially a button with a close icon. It is used to handle the close functionality in feedback and overlay components like Alerts, Toasts, Drawers and Modals.

Import#

import { CloseButton } from "@chakra-ui/react"

Usage#

Editable Example

Button Size#

Pass the size prop to adjust the size of the close button. Values can be sm, md or lg.

Editable Example

Props#

The CloseButton composes Box component.

NameTypeDescriptionDefault
colorScheme"blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "whiteAlpha" | "blackAlpha" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"Color Schemes for CloseButton are not implemented in the default theme. You can extend the theme to implement them.-
isDisabledbooleanIf `true`, the close button will be disabled.-
size"sm" | "md" | "lg""md"
variantstringVariants for CloseButton are not implemented in the default theme. You can extend the theme to implement them.-