Componentform0.8 KB gzipZero dependencies

Consent Checkbox

GDPR/KVKK consent checkbox with link and required marker.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add consent-checkbox

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { ConsentCheckbox } from "@/components/ui/consent-checkbox"; <ConsentCheckbox />

Source code

consent-checkbox.tsx + 1 helper

Zero 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 />
PropTypeDescription
textstringConfigures text.
linkLabelstringConfigures link label. (Default: "devam et")
linkHrefstringConfigures link href. (Default: "#")
checkedbooleanControlled checked state.
onCheckedChange(checked: boolean) => voidCallback invoked on checked change.
requiredbooleanMarks the input as required for native form validation.