Close Button
An interactive component specifically styled to dismiss or close parent overlays, alerts, or panels.
Usage
Sizes
Use the close-button-{size} class to control the component size.
Size values can include:smmdlgxl.
For more information on all available sizing utilities, visit Tailwind
Variants
Use the variant and palette classes to control the appereance of the component.
Variant values can include solidoutlinesurfacesubtleghostlinkplain.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.
Customizing
globals.css
:root {
--ex-close-button-cursor: pointer;
--ex-close-button-font-size-sm: var(--text-sm);
--ex-close-button-font-size-md: var(--text-base);
--ex-close-button-font-size-lg: var(--text-lg);
--ex-close-button-font-size-xl: var(--text-xl);
--ex-close-button-size-sm: calc(var(--spacing) * 7);
--ex-close-button-size-md: calc(var(--spacing) * 8);
--ex-close-button-size-lg: calc(var(--spacing) * 9);
--ex-close-button-size-xl: calc(var(--spacing) * 10);
--ex-close-button-radius-sm: var(--radius-sm);
--ex-close-button-radius-md: var(--radius-sm);
--ex-close-button-radius-lg: var(--radius-sm);
--ex-close-button-radius-xl: var(--radius-sm);
}API
| Element | Selector |
|---|---|
CloseButton | .ex-close-button |
| Prop | Type | Default |
|---|---|---|
as | ElementType | button |
asChild | boolean | false |
Last updated on