Purbayan Pramanik

Checkbox Group

Forms

About

A multi-select list of checkboxes where checking rows highlights the nearest item on hover and merges contiguous checked rows into one continuous background block instead of showing separate highlighted rows.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Checkbox Group to your project and fits it to your theme.

Code

How Checkbox Group is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import {
  CheckboxGroup,
  CheckboxGroupItem,
} from "@/components/ui/checkbox-group";
import { useState } from "react";

const todos = [
  { name: "wireframes", label: "Sketch wireframes" },
  { name: "review", label: "Review with design" },
  { name: "copy", label: "Write onboarding copy" },
  { name: "build", label: "Build the empty states" },
  { name: "qa", label: "QA on staging" },
  { name: "ship", label: "Ship to production" },
];

// Pre-checked non-contiguously (rows 1, 3, 4, 5) so checking "Write
// onboarding copy" (row 2) bridges two existing runs into one merged block,
// and unchecking any interior row splits it back apart.
export default function CheckboxGroupBasicExample() {
  const [value, setValue] = useState<string[]>([
    "review",
    "build",
    "qa",
    "ship",
  ]);

  return (
    <div className="w-full max-w-sm">
      <CheckboxGroup value={value} onValueChange={setValue}>
        {todos.map((todo) => (
          <CheckboxGroupItem key={todo.name} name={todo.name}>
            {todo.label}
          </CheckboxGroupItem>
        ))}
      </CheckboxGroup>
    </div>
  );
}

Dependencies

More by Purbayan Pramanik

View all
  • Notification Stack

    Notification Stack

    29
  • Proximity Accordion

    Proximity Accordion

    6
  • Plan Checklist

    Plan Checklist

  • Agent Activity

    Agent Activity

  • Snap Panels

    Snap Panels

  • Conversation

    Conversation

More in Forms

View all
  • Premium Auth

    Premium Auth

    526
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    28
  • Book A Demo 1

    Book A Demo 1

    74
  • Login 1

    Login 1

    54
  • Login Card

    Login Card

    33
  • Split Sign In Form

    Split Sign In Form

    62
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.6K