Fidely UI v1 beta is now available!. 🚀

Close Button

A button used to close modals, drawers, alerts, and other dismissible elements.

Usage

import { CloseButton } from '@fidely-ui/react'
<CloseButton />

The CloseButton component inherits all props available in the Button component.

To change the default icon, wrap your custom icon as a child:

<CloseButton>
  <YourCustomIcon />
</CloseButton>

Props

CloseButton

PropTypeDefaultDescription
size"2xs" | "xs" | "sm" | "md" | "lg" | "md" | "lg" | "xl" | "2xl" Defines the size of the close button.
colorPalette"gray" | "red" | "blue" | "green" | "purple" | "orange""gray"Sets the color palette for the button.
variant"solid" | "subtle" | "outline" | "ghost""ghost"Defines the visual style of the button.
childerenReactNode<XIcon />The icon displayed inside the button. Defaults to a close (×) icon.
aria-labelstring"Close"Accessible label for screen readers.
onClick() => void-Called when the close button is clicked.
disabledbooleanfalseDisables the button when set to true.
asChildbooleanfalsePasses props to a custom element instead of rendering a default <button>.