checkbox
fulldev-ui/checkboxFreeComponent
fulldev/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by fulldev/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.full.dev/r/checkbox.jsonSource
1---2import type { HTMLAttributes } from "astro/types"34import { cn } from "@/lib/utils"56type Props = Omit<HTMLAttributes<"input">, "type">78const { class: className, ...props } = Astro.props9---1011<input12 type="checkbox"13 role="checkbox"14 data-slot="checkbox"15 class={cn(16 "border-input dark:bg-input/30 checked:bg-primary dark:checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary aria-invalid:checked:border-primary aria-invalid:indeterminate:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 checked:[color:var(--color-primary-foreground)] indeterminate:[color:var(--color-primary-foreground)] focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",17 className18 )}19 {...props}20/>2122<style>23 [data-slot="checkbox"] {24 color: inherit;25 }2627 [data-slot="checkbox"]::before {28 content: "";29 position: absolute;30 inset: 0;31 margin: auto;32 width: 14px;33 height: 14px;34 opacity: 0;35 background-color: currentColor;36 background-repeat: no-repeat;37 background-position: center;38 background-size: 14px 14px;39 -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");40 -webkit-mask-repeat: no-repeat;41 -webkit-mask-position: center;42 -webkit-mask-size: 14px 14px;43 mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");44 mask-repeat: no-repeat;45 mask-position: center;46 mask-size: 14px 14px;47 }4849 [data-slot="checkbox"]:checked,50 [data-slot="checkbox"]:indeterminate {51 color: var(--color-primary-foreground);52 }5354 [data-slot="checkbox"]:checked::before {55 opacity: 1;56 }5758 [data-slot="checkbox"]:indeterminate::before {59 opacity: 1;60// … truncated
Files it writes
More from fulldev/ui
All 144 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | fulldev/ui | Components | Free | 1 dep · 5 files | |
| alertalert | fulldev/ui | Components | Free | no deps · 5 files | |
| alert-dialogalert-dialog | fulldev/ui | Components | Free | 1 dep · 13 files | |
| avataravatar | fulldev/ui | Components | Free | no deps · 7 files | |
| badgebadge | fulldev/ui | Components | Free | no deps · 3 files | |
| bannerbanner | fulldev/ui | Components | Free | no deps · 3 files | |
| breadcrumbbreadcrumb | fulldev/ui | Components | Free | no deps · 8 files | |
| buttonbutton | fulldev/ui | Components | Free | no deps · 3 files |
