Skip to content
v0.2.10

Checkbox

A labeled native checkbox for independent choices.

Preview

Use Checkbox

Checkbox is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
checkbox.tsxTSX
"use client";

import { FloodRoot, Checkbox } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Checkbox label="Send project updates" name="updates" defaultChecked />
    </FloodRoot>
  );
}

Design notes

  • Use checked/onChange for controlled state or defaultChecked for native state.
  • Labels stay visible. Disabled does not mean read-only; explain unavailable choices outside the disabled control when needed.
  • The control and visible label form one content-width unit with an 8px-at-16px-root internal gap. Use an explicit parent gap="4" (16px at that root) between units; the glyph keeps its token-defined size.
  • indeterminate sets the native mixed state after hydration; checked still controls form submission. The host owns select-all aggregation and updates. Radio and Switch do not expose this prop.

API reference

PropValuesDefault
labelReactNodeRequired
indeterminatebooleanfalse
Native HTML propsOmit<InputHTMLAttributes<HTMLInputElement>, "type" | "size">Forwarded
View TypeScript source