Propel

Checkbox Field

A single checkbox laid out as a field row with label, description, and hint or error text.

Basic

Send a message when the deployment status changes.

You can change this later.

Show code
import { CheckboxField } from "@makeplane/propel/components/checkbox-field";

export default function BasicDemo() {
  return (
    <CheckboxField
      name="emailUpdates"
      value="enabled"
      label="Email updates"
      magnitude="md"
      description="Send a message when the deployment status changes."
      hint="You can change this later."
      defaultChecked
    />
  );
}

Magnitudes

magnitude scales the label, description, and helper text; the checkbox box keeps one size.

Notify me when a work item is assigned to me.

You can change this later.

Notify me when a work item is assigned to me.

You can change this later.

Notify me when a work item is assigned to me.

You can change this later.

Show code
import { CheckboxField } from "@makeplane/propel/components/checkbox-field";

export default function MagnitudesDemo() {
  return (
    <div className="flex flex-col gap-4">
      <CheckboxField
        name="notify-md"
        value="md"
        label="Comfortable"
        magnitude="md"
        description="Notify me when a work item is assigned to me."
        hint="You can change this later."
      />
      <CheckboxField
        name="notify-lg"
        value="lg"
        label="Roomy"
        magnitude="lg"
        description="Notify me when a work item is assigned to me."
        hint="You can change this later."
      />
      <CheckboxField
        name="notify-xl"
        value="xl"
        label="Spacious"
        magnitude="xl"
        description="Notify me when a work item is assigned to me."
        hint="You can change this later."
      />
    </div>
  );
}

Invalid

Setting error marks the field invalid, recoloring the box border to danger and showing the error text in place of the hint.

You must accept the terms to continue.
Show code
import { CheckboxField } from "@makeplane/propel/components/checkbox-field";

export default function InvalidDemo() {
  return (
    <div className="flex flex-col gap-4">
      <CheckboxField name="digest" value="enabled" label="Send me a weekly digest" magnitude="md" />
      <CheckboxField
        name="terms"
        value="accepted"
        label="Accept the workspace terms"
        magnitude="md"
        error="You must accept the terms to continue."
      />
    </div>
  );
}

Controlled

Move items to the archive one week after they are marked done.

Archiving is off.

Show code
import { CheckboxField } from "@makeplane/propel/components/checkbox-field";
import * as React from "react";

export default function ControlledDemo() {
  const [checked, setChecked] = React.useState(false);

  return (
    <CheckboxField
      name="autoArchive"
      value="enabled"
      label="Auto-archive completed work items"
      magnitude="md"
      description="Move items to the archive one week after they are marked done."
      hint={checked ? "Archiving is on." : "Archiving is off."}
      checked={checked}
      onCheckedChange={setChecked}
    />
  );
}

Installation

import { CheckboxField } from "@makeplane/propel/components/checkbox-field";

Props

CheckboxField

PropTypeRequiredDescription
sizing"hug" | "fill"NoWidth of the clickable label row when `label` is present. Defaults to `"hug"` (ready-made concern — the elements `CheckboxLabel` requires `sizing` explicitly).
hintReactNodeNoHelper text shown below the control. Replaced by `error` when an error is set.
errorReactNodeNoError text shown below the control.
labelstringYesVisible field label.
magnitude"md" | "lg" | "xl"YesLabel and helper text size.
descriptionReactNodeNoOptional supporting text announced as the checkbox description.