Checkmark
Draws a check mark that shows a checked or indeterminate state. It is display only.
Usage
import { Checkmark } from '@leverui/components';
<Checkmark checked />
Examples
Indeterminate
Use the indeterminate prop to show an indeterminate state.
States
The Checkmark component supports three states: unchecked (default), checked, and indeterminate.
Variants
Use the variant prop to change the visual style of the checkmark.
Sizes
Use the size prop to change the size of the checkmark.
Colors
Use the colorPalette prop to change the color scheme of the checkmark.
Filled
Use the filled prop with the outline variant to add a background color to the checkmark.
Props
| Prop | Default | Type | Description |
|---|---|---|---|
colorPalette | gray | string | Color palette. Built-in or your own. |
size | md | 'xs' | 'sm' | 'md' | 'lg' | Checkmark size. Responsive. |
variant | solid | 'solid' | 'outline' | 'subtle' | 'plain' | 'inverted' | Checkmark style. Responsive. |
checked | — | boolean | Show the check icon. |
indeterminate | — | boolean | Show the indeterminate icon. Wins over checked. |
disabled | — | boolean | Show the disabled look. |
as | svg | Native SVG tag | SVG tag to render. |
asChild | — | Solid render function | Render your own element with the checkmark's props. |
filled | — | boolean | Add a background to the outline variant. Responsive. |
Display only. Checkmark holds no state and does not react to clicks, so
connect it to your app's state or to an interactive control.
No role or accessible name by default. Add aria-hidden="true" when a control
next to it already gives the state. Add a role and a name when the SVG itself
carries the information.
Customize with CSS
The SVG has data-state, data-size, data-variant, and data-filled. Your
CSS overrides the defaults without !important.
<Checkmark checked class="order-checkmark" />
.order-checkmark {
border-radius: 50%;
--leverui-colors-color-palette-solid: rebeccapurple;
}
unstyled turns off the default styles. The icon, the state attributes, and
the SVG element stay.