my/ui

Command Palette

Search for a command to run...

All components

Horizontal Checkbox Group

checkboxes

Origin UI component.

responsive · 600px

Install

Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:

$npx shadcn@latest add https://your-domain/r/comp-139.json

Usage

import Cmp from "@/registry/origin-ui/comp-139";

export default function Demo() {
  return <Cmp />;
}

Component source

import { useId } from "react";

import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";

export default function Component() {
  const id = useId();
  return (
    <div className="flex gap-6">
      <div className="flex items-center gap-2">
        <Checkbox id={`${id}-a`} />
        <Label htmlFor={`${id}-a`}>React</Label>
      </div>
      <div className="flex items-center gap-2">
        <Checkbox id={`${id}-b`} />
        <Label htmlFor={`${id}-b`}>Next.js</Label>
      </div>
      <div className="flex items-center gap-2">
        <Checkbox id={`${id}-c`} />
        <Label htmlFor={`${id}-c`}>Astro</Label>
      </div>
    </div>
  );
}

Source: Origin UI