121 Pro components and page blocks

Get Pro

Updated

Checkbox

New

Preview

Customize

Medium
Duration0.25s

Installation

npx shadcn@latest add https://uibrik.com/r/checkbox.json
Adds the files to components/uibrik/checkbox and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/checkbox.

Usage

import { CheckboxGroup } from "@/components/uibrik/checkbox/checkbox";​const options = [  { value: "comments", label: "Comments", description: "Replies to your posts and threads." },  { value: "mentions", label: "Mentions", description: "When someone tags you by name." },  // …2 more];​<CheckboxGroup  options={options}  size="md"  rangeSelect  duration={0.25}  disabled={false}  defaultValue={["comments", "mentions"]}  selectAll="Email notifications"  label="Email notifications"  // value={["…"]}  // onChange={(value) => {}}  // name="…"  // Checkbox={…}/>

Where to use Checkbox

  • Forms and settings

    A check that draws itself on gives clear, satisfying feedback.

    Pairs with Radio Group

  • Table row selection

    A dash for partly ticked select-all and shift-click range select suit tables.

    Pairs with Data Table

  • Terms and consent

    An accessible, clear checkbox fits legal agreements.

    Pairs with Cookie Consent

Props

CheckboxGroup
size
Type "sm" | "md" | "lg"
"md"
Box and text size.
rangeSelect
Type boolean
true
Shift-click ticks every box between the last click and this one.
duration
Type number
0.25
How long the check takes to draw.
disabled
Type boolean
false
Grey the group out and ignore clicks.
optionsrequired
Type (string | { value; label; description?; disabled? })[]
–
Boxes in order.
value / onChange
Type string[] / (value) => void
–
Controlled ticked values, in the options' order.
defaultValue
Type string[]
–
Ticked values on mount when uncontrolled.
selectAll
Type ReactNode
–
Label for a parent box that ticks them all and goes indeterminate when only some are ticked.
name
Type string
–
Submits each ticked value under this name with a surrounding form.
label
Type string
–
Names the group for screen readers.
className
Type string
–
Classes for the group.
Checkbox
Type component
–
A single box: checked / defaultChecked / onCheckedChange (true, false or "indeterminate"), label, description, size, disabled, name.