Radiomark

Draws the dot of a radio button that shows a selected state. It is display only.

Usage

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

Examples

States

The Radiomark component supports checked and unchecked states, with optional disabled state.

Variants

Use the variant prop to change the visual style of the radiomark.

Sizes

Use the size prop to change the size of the radiomark.

Colors

Use the colorPalette prop to change the color scheme of the radiomark.

Filled

Use the filled prop with the outline variant to add a background color to the radiomark.

Props

PropDefaultTypeDescription
colorPalettegraystringColor palette, built-in or your own.
variantsolid'solid' | 'subtle' | 'outline' | 'inverted'Radiomark style. Responsive.
sizemd'xs' | 'sm' | 'md' | 'lg'Radiomark size. Responsive.
checked—booleanShow the dot that marks the option as selected.
disabled—booleanMake the radiomark look disabled.
asspanNative HTML tagHTML tag to render.
asChild—Solid render functionRender your own element with the radiomark's props.
filled—booleanAdd a background to the outline variant. Responsive.

Visual only. It has no state, radio input, role, accessible name, or focus. Put the radio role and the label on the control that owns the mark, and pass that control's checked and disabled state to the mark. Ignores children. With data-invalid or aria-invalid="true" and no palette set, it uses the error palette.

Customize with CSS

Import @leverui/components/styles.css before your own stylesheet. Style .leverui-radiomark, or .leverui-radiomark__dot for the dot. Props show up as data-size, data-variant, and data-filled. A value for one screen size adds a suffix, such as data-size-md. State shows up as data-checked and data-disabled, the palette as data-leverui-color-palette.

Code
.leverui-radiomark[data-checked] {
  outline-offset: 3px;
}

unstyled turns off the default styles. The classes and attributes stay.