Command Palette

Search for a command to run...

Docs
Checkbox Terms

Checkbox Terms

A checkbox for accepting terms of service and privacy policy with linked text.

Installation

Usage

import { useState } from "react";
import CheckboxTerms from "@/components/ruixen/checkbox-terms";
 
export default function MyComponent() {
  const [accepted, setAccepted] = useState(false);
 
  return (
    <CheckboxTerms
      checked={accepted}
      onCheckedChange={setAccepted}
      termsLink="/terms"
      privacyLink="/privacy"
      required
    />
  );
}

Props

PropTypeDefaultDescription
checkedboolean-Controlled checked state
defaultCheckedbooleanfalseDefault checked state
onCheckedChange(checked: boolean) => void-Callback when state changes
termsTextstring"Terms of Service"Terms link text
termsLinkstring"#"Terms page URL
privacyTextstring"Privacy Policy"Privacy link text
privacyLinkstring"#"Privacy page URL
requiredbooleanfalseMark as required
disabledbooleanfalseDisable the checkbox
classNamestring-Additional CSS classes

Features

  • Pre-formatted terms acceptance text
  • Clickable links for terms and privacy
  • Required field indicator
  • Perfect for signup forms
  • Light and dark mode support