Components

CloseButton

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

Import

import { CloseButton } from '@outfitio/outkit';

Usage

Button Size

Use the size prop to change the size of the button. You can set the value to sm, md, or lg.

Accessibility

  • The close button component semantically renders as <button>.
  • Close buttons use browser defaults for keyboard interaction. Give buttons keyboard focus with the tab key (or shift + tab when tabbing backwards). Activate buttons with the enterreturn or space key

Best Practice

  • When used in a modal or drawer, the close button should not be focused by default.

Props

The CloseButton composes PseudoBox component.

NameTypeDefaultDescription
aria-labelstringAn accessible label for the close button
isDisabledbooleanIf true, the button will be disabled
colorstringThe color of the close icon
sizesm, md, lgmdThe size of the close button