Close Button
The × that closes a panel, dialog, toast or chip. A ghost square like the ⋯ icon button: a muted × that turns dark on hover, #f5f5f5 behind it on hover and #e9ebef pressed.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { CloseButton } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use it for the × on a panel, dialog, toast or chip, so every close looks and behaves the same: muted until hovered, named Close by default. |
| Do | Set aria-label to say what closing does when Close isn't enough, like Remove Jane Citizen on a chip. In a list of chips each name must be unique. |
| Do | Use size="inline" in toasts and chips. The × is 16 px but its hit area still reaches the 24 px minimum. |
| Do | Match the size to the icon buttons beside it in the same header (xs 28, sm 32, md 36, lg 40), so the × lines up with them. |
| Don't | Build a close with an IconButton and an X icon. Use CloseButton, which keeps the muted colour and the default name. |
| Don't | Use it to delete a record, like a contact or a matter. Use a Button with intent="destructive" behind a confirmation. |
Props
Also takes every prop of ui-sdk's Button: onClick, disabled, focusableWhenDisabled and render.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "xs" | "sm" | "md" | "lg" | "inline" | "xs" | xs 28, sm 32, md 36 and lg 40 are ghost squares. Inline is a bare 16 px × for toasts and chips, with a 24 px hit area. |
| aria-label | string | "Close" | What closing does, when "Close" isn't enough, like "Remove Jane Citizen". |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { CloseButton } from "@leap-crm/design-system";
<CloseButton />Labelled
It's named Close by default. Say what closing does when that's clearer, like removing a person from a list.
What the examples share
The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.
import { Fragment } from "react";
import { CloseButton } from "@leap-crm/design-system";
const sizes = ["xs", "sm", "md", "lg", "inline"] as const;Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| EnterSpace | Presses the focused button. |







