felipemenezes098

Switch with TanStack Form and Zod

Forms

About

A toggle switch wired into a form with TanStack Form and validated by a Zod schema that surfaces a field error when the required opt-in is off.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Switch with TanStack Form and Zod to your project and fits it to your theme.

Code

How Switch with TanStack Form and Zod is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Switch13 } from "@/components/ui/switch-13";
import { Toaster } from "sonner";

export default function Demo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center p-6">
      <Switch13 />
      <Toaster />
    </div>
  );
}

Dependencies

More by felipemenezes098

View all
  • Centered Hero with Image Fan

    Centered Hero with Image Fan

    1K
  • Editorial Collage Hero

    Editorial Collage Hero

    474
  • Split Hero With Image Cards

    Split Hero With Image Cards

    436
  • Editorial Image Hero

    Editorial Image Hero

    402
  • Scroll 01

    Scroll 01

    380
  • Real Estate Search Hero

    Real Estate Search Hero

    206
  • Editorial Hero

    Editorial Hero

    191
  • Hero with Dashboard Mockup

    Hero with Dashboard Mockup

    137

More in Forms

View all
  • Premium Auth

    Premium Auth

    543
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    17
  • Card Studio

    Card Studio

    46
  • Login 2

    Login 2

    10
  • Book A Demo 1

    Book A Demo 1

    80
  • Login 1

    Login 1

    58
  • Input

    Input

    14