Booking Form

Complete booking creation and editing form

SaaSBooking

Overview

BookingForm provides a full-featured booking form supporting create, edit, and view modes. It includes title, description, time slot, resource, timezone, and attendee fields with built-in validation.

Usage

import { BookingForm } from "@leanicon/web-builder-library/saas";

<BookingForm
  mode="create"
  resources={[
    { id: "room-1", name: "Conference Room A" },
    { id: "room-2", name: "Conference Room B" },
  ]}
  availableUsers={[
    { userId: "1", name: "John Doe", email: "[email protected]" },
    { userId: "2", name: "Jane Smith", email: "[email protected]" },
  ]}
  onSubmit={(values) => console.log("Submitted:", values)}
  onCancel={() => console.log("Cancelled")}
/>;

Variants

Create Mode

0/100 characters

0/500 characters

Create Mode (Dark)

0/100 characters

0/500 characters

Edit Mode

19/100 characters

32/500 characters

Duration: 30m

John DoeJane Smith

View Mode

19/100 characters

32/500 characters

Duration: 30m

John Doe

Loading

0/100 characters

0/500 characters

With Error

0/100 characters

0/500 characters

With Max Attendees

0/100 characters

0/500 characters

0 / 5 attendees

Props

NameTypeDefaultRequiredDescription
modeenumcreateNoForm mode
valuesPartial<BookingFormData>—NoInitial/current values
loadingbooleanfalseNoWhether form is in loading state
errorstring—NoError message to display
resources{ id: string; name: string; }[]—YesAvailable resources for selection
availableUsersUserOption[][]NoAvailable users for attendee selection
initialAttendeesAttendeeData[][]NoInitial attendees (for edit mode)
maxAttendeesnumber—NoMaximum number of attendees allowed
classNamestring—NoCustom class name
onSubmit(values: BookingFormData) => void | Promise<void>—YesCalled when form is submitted with valid data
onCancel() => void—YesCalled when cancel is clicked
onValidationChange((isValid: boolean, errors: ValidationErrors) => void)—NoCalled when validation state changes
onChange((values: Partial<BookingFormData>, fieldName: string) => void)—NoCalled when any field value changes
onSearchAttendees((query: string) => UserOption[] | Promise<UserOption[]>)—NoCalled when searching for attendees (for async user search)