Simple Checkout Form 1
shadcnstore/checkout-form-1FreeBlock
A clean and straightforward checkout form with essential fields
Install it
npx shadcn@latest add https://shadcnstore.com/r/checkout-form-1.jsonSource
1'use client'23import { useState } from 'react'4import { ArrowLeft, Lock } from 'lucide-react'56import { Button } from '@/components/ui/button'7import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'89import { initialCheckoutForm1Data, type CheckoutForm1Data } from "@/components/data/checkout-form-1-data"10import { CheckoutForm1ContactStep } from './checkout-form-1-contact-step'11import { CheckoutForm1OrderSummary } from './checkout-form-1-order-summary'12import { CheckoutForm1PaymentStep } from './checkout-form-1-payment-step'13import { CheckoutForm1Progress } from './checkout-form-1-progress'14import { CheckoutForm1ShippingStep } from './checkout-form-1-shipping-step'1516const STEP_COPY = [17 { title: 'Contact Information', description: "We'll use this to send you order updates" },18 { title: 'Shipping Address', description: 'Where should we deliver your order?' },19 { title: 'Payment Details', description: 'Your payment information is secure and encrypted' },20]2122export function CheckoutForm1() {23 const [step, setStep] = useState(1)24 const [formData, setFormData] = useState<CheckoutForm1Data>(initialCheckoutForm1Data)2526 const handleInputChange = (field: keyof CheckoutForm1Data, value: string | boolean) => {27 setFormData(prev => ({ ...prev, [field]: value }))28 }2930 /** Card numbers read in four-digit groups, so the value is reformatted as it is typed. */31 const handleCardNumberChange = (value: string) => {32 const formatted = value33 .replace(/\s/g, '')34 .replace(/(.{4})/g, '$1 ')35 .trim()36 handleInputChange('cardNumber', formatted)37 }3839 const handleExpiryChange = (value: string) => {40 const formatted = value.replace(/\D/g, '').replace(/(\d{2})(\d)/, '$1/$2')41 handleInputChange('expiryDate', formatted)42 }4344 const nextStep = () => setStep(prev => Math.min(prev + 1, STEP_COPY.length))45 const prevStep = () => setStep(prev => Math.max(prev - 1, 1))4647 return (48 <div className='bg-muted/30'>49 <div className='mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-8'>50 <div className='mb-8 text-center'>51 <h1 className='mb-2 text-3xl font-bold text-balance'>Secure Checkout</h1>52 <p className='text-muted-foreground'>Complete your purchase in just a few steps</p>53 </div>5455 <CheckoutForm1Progress step={step} />5657 <div className='grid gap-8 lg:grid-cols-3'>58 <div className='lg:col-span-2'>59 <Card>60 <CardHeader>61// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from ShadcnStore
All 228 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| About 1about-1 | ShadcnStore | Blocks | Free | 1 dep · 3 files | |
| About 2about-2 | ShadcnStore | Blocks | Paid | 2 deps · 3 files | |
| AI Chat 1ai-chat-1 | ShadcnStore | Blocks | Free | 2 deps · 4 files | |
| AI Chat 2ai-chat-2 | ShadcnStore | Blocks | Paid | 1 dep · 4 files | |
| AI Prompt 1ai-prompt-1 | ShadcnStore | Blocks | Paid | 1 dep · 3 files | |
| App Dashboard 1app-1 | ShadcnStore | Blocks | Free | 1 dep · 4 files | |
| Task Management 2app-2 | ShadcnStore | Blocks | Paid | 2 deps · 4 files | |
| Foundational Application Shellapp-shell-1 | ShadcnStore | Blocks | Free | 1 dep · 4 files |
