Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 801 Bytes

File metadata and controls

45 lines (31 loc) · 801 Bytes

Checkbox

A styled checkbox input with optional label.

Import

import { Checkbox } from '@florex/ui';

Usage

<Checkbox label="Accept terms" />

Props

Prop Type Default Description
label string Text label displayed next to the checkbox
id string HTML id (links label to input)
className string Additional CSS classes

Also accepts all native <input> HTML attributes (except type).

Examples

Controlled

const [checked, setChecked] = useState(false);

<Checkbox
  label="Enable notifications"
  checked={checked}
  onChange={(e) => setChecked(e.target.checked)}
/>

Disabled

<Checkbox label="Read-only option" disabled checked />