Checkbox
blok/checkboxFreeComponent
Allows users to select multiple items from a list of options.
Install it
npx shadcn@latest add https://blok.sitecore.com/r/checkbox.jsonSource
1"use client";23import { Icon } from "@/lib/icon";4import { mdiCheck } from "@mdi/js";5import { Checkbox as CheckboxPrimitive } from "radix-ui";6import type * as React from "react";78import { cn } from "@/lib/utils";910function Checkbox({11 className,12 "aria-label": ariaLabel,13 ...props14}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {15 return (16 <CheckboxPrimitive.Root17 data-slot="checkbox"18 aria-label={ariaLabel}19 className={cn(20 "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",21 className,22 )}23 {...props}24 >25 <CheckboxPrimitive.Indicator26 data-slot="checkbox-indicator"27 className="data-[state=checked]:border-info-fg data-[state=checked]:bg-info-fg data-[state=checked]:text-inverse-text dark:data-[state=checked]:border-info-fg dark:data-[state=checked]:bg-info-fg"28 >29 <Icon path={mdiCheck} size={0.8} />30 </CheckboxPrimitive.Indicator>31 </CheckboxPrimitive.Root>32 );33}3435export { Checkbox };
What it pulls in
npm packages
Other registry items
Files it writes
More from blok
All 72 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blok | Components | Free | 2 deps · 2 files | |
| Action baraction-bar | blok | Components | Free | 1 dep · 2 files | |
| Alertalert | blok | Components | Free | 2 deps · 2 files | |
| Alert dialogalert-dialog | blok | Components | Free | 2 deps | |
| Aspect ratioaspect-ratio | blok | Components | Free | 1 dep | |
| Avataravatar | blok | Components | Free | 1 dep | |
| Badgebadge | blok | Components | Free | 2 deps | |
| All componentsblok-components | blok | Components | Free | no deps |
