LaviKatiyar

Form

Forms 62

About

Booking Form Description: A compact and visually polished form for handling travel or accommodation bookings. It features distinct sections for destination, dates, rooms, and guests, with smooth animations powered by Framer Motion. The component is fully responsive and adapts to both light and dark themes using shadcn/ui variables.

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

Code

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

Usage.tsx

// demo.tsx
import React, { useState } from 'react';
import { BookingForm } from '@/components/ui/form'; // Adjust path as needed

export default function BookingFormDemo() {
  const [destination, setDestination] = useState('Bali, Indonesia');

  // Placeholder handlers for demonstration purposes
  const handleDateRangeClick = () => {
    alert('Date range selector opened!');
  };

  const handleRoomsClick = () => {
    alert('Room selector opened!');
  };

  const handleGuestsClick = () => {
    alert('Guest selector opened!');
  };

  const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
    e.preventDefault();
    alert('Checking availability...');
  };

  return (
    <div className="flex h-screen w-full items-center justify-center bg-background p-4">
      <BookingForm
        destination={destination}
        dateRange="8 May - 9 May"
        rooms={2}
        guests={4}
        onDestinationChange={(e) => setDestination(e.target.value)}
        onDateRangeClick={handleDateRangeClick}
        onRoomsClick={handleRoomsClick}
        onGuestsClick={handleGuestsClick}
        onSubmit={handleSubmit}
      />
    </div>
  );
}

Dependencies

More by LaviKatiyar

View all
  • Hero Section

    Hero Section

    847
  • Cards

    Cards

    688
  • Service Card

    Service Card

    635
  • Card

    Card

    559
  • Alert Toast

    Alert Toast

    503
  • Bento Grid

    Bento Grid

    431
  • Freelancer Profile Card

    Freelancer Profile Card

    377
  • Referral Card

    Referral Card

    310

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19