Close Button

A small button with an X icon that closes a dialog, a drawer, or a message.

Usage

Code
import { CloseButton } from '@leverui/components';
Code
<CloseButton />

Examples

Sizes

Use the size prop to change the size of the close button.

Variants

Use the variant prop to change the appearance of the close button.

Custom Icon

Pass the custom icon to the children of the CloseButton component.

Props

PropDefaultTypeDescription
spinnerPlacementstart'start' | 'end'Side the spinner sits on.
colorPalettegraystringColor palette, built in or your own.
sizemd'2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'Button size.
variantsolid'solid' | 'subtle' | 'surface' | 'outline' | 'ghost' | 'plain'Button style.
loadingfalsebooleanShow a loading spinner.
loadingText—JSX.ElementText shown while loading.
spinner—JSX.ElementSpinner shown while loading.
asbuttonNative HTML tagHTML tag to render.
asChild—Solid render functionRender your own element with the button's props.

Has its own "Close" label and icon. Accepts button attributes and event handlers.