Checkmark

Draws a check mark that shows a checked or indeterminate state. It is display only.

Usage

Code
import { Checkmark } from '@leverui/components';
Code
<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

PropDefaultTypeDescription
colorPalettegraystringColor palette. Built-in or your own.
sizemd'xs' | 'sm' | 'md' | 'lg'Checkmark size. Responsive.
variantsolid'solid' | 'outline' | 'subtle' | 'plain' | 'inverted'Checkmark style. Responsive.
checked—booleanShow the check icon.
indeterminate—booleanShow the indeterminate icon. Wins over checked.
disabled—booleanShow the disabled look.
assvgNative SVG tagSVG tag to render.
asChild—Solid render functionRender your own element with the checkmark's props.
filled—booleanAdd 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.

Code
<Checkmark checked class="order-checkmark" />
Code
.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.