Componentform0.8 KB gzipZero dependencies
Consent Checkbox
GDPR/KVKK consent checkbox with link and required marker.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add consent-checkboxOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { ConsentCheckbox } from "@/components/ui/consent-checkbox"; <ConsentCheckbox />Source code
consent-checkbox.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxconsent-checkbox.tsx52 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ConsentCheckboxProps extends Omit<React.HTMLAttributes<HTMLLabelElement>, "onChange"> { text: string; linkLabel?: string; linkHref?: string; checked?: boolean; onCheckedChange?: (checked: boolean) => void; required?: boolean;} /** Consent checkbox: legal agreement link + stamp effect. */export function ConsentCheckbox({ text, linkLabel = "devam et", linkHref = "#", checked, onCheckedChange, required, className, ...props }: ConsentCheckboxProps) { const [internal, setInternal] = React.useState(false); const isOn = checked ?? internal;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { ConsentCheckbox } from "@/components/ui/consent-checkbox"; <ConsentCheckbox />| Prop | Type | Description |
|---|---|---|
| text | string | Configures text. |
| linkLabel | string | Configures link label. (Default: "devam et") |
| linkHref | string | Configures link href. (Default: "#") |
| checked | boolean | Controlled checked state. |
| onCheckedChange | (checked: boolean) => void | Callback invoked on checked change. |
| required | boolean | Marks the input as required for native form validation. |