nylas-booking-form
Overview
The nylas-booking-form
component is a UI component that allows users to book an event.
The booking form component.
Version | 1.1.4 |
Install (React) | npm install @nylas/react |
Import (React) | import { NylasBookingForm } from '@nylas/react'; |
Import (CDN) | <script type="module">
import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/nylas-booking-form/nylas-booking-form.es.js";
defineCustomElement();
</script> |
Example
Properties
Standalone Props
ⓘ NOTE: The following props are automatically configured when used within nylas-scheduling. Set these props manually only if you’re using the component independently.
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
bookingInfo | The booking info. | undefined | { primaryParticipant: NylasSchedulerBookingParticipant; startTime?: Date | undefined; endTime?: Date | undefined; timezone?: string | undefined; guests?: NylasSchedulerBookingParticipant[] | undefined; additionalFields?: Record<string, { value: string; type: string; }> | undefined; } | undefined | |
configSettings | The config settings for the scheduler. | undefined | { configuration_id: string; scheduler: { available_days_in_future: number; min_cancellation_notice: number; min_booking_notice: number; rescheduling_url?: string | undefined; cancellation_url?: string | undefined; cancellation_policy?: string | undefined; hide_additional_guests?: boolean | undefined; hide_cancellation_options?: boolean | undefined; hide_rescheduling_options?: boolean | undefined; additional_fields?: Record<string, AdditionalFields> | undefined; confirmation_redirect_url?: string | undefined; organizer_confirmation_url?: string | undefined; }; organizer: { name: string; email: string; }; slug: string; appearance: Appearance; booking_type: string; name: string; } | undefined | |
eventInfo | The booked event (Used to track if a booking is created in an eventOverride). | undefined | { booking_id: string; organizer: { email: string; name: string; is_organizer?: boolean | undefined; }; title: string; description: string; status: string; } | undefined | |
isLoading | The loading state. | boolean | undefined | undefined |
Events
Event | Description | Type |
---|---|---|
backButtonClicked | This event is fired when the cancel button is clicked. | CustomEvent<boolean> |
bookingFormError | This event is fired when an error occurs in the booking form validation. | CustomEvent<{ id?: string | undefined; type?: NotificationType | undefined; title?: string | undefined; code?: number | undefined; category?: string | undefined; description?: string | undefined; ttl?: number | "none" | undefined; }> |
bookingFormSubmitted | This event is fired immediately after the book button is clicked. The booking form validation is not complete at this point. | CustomEvent<void> |
detailsConfirmed | This event is fired when the book button is clicked and the form validation is complete and successful. This event is fired before the booking request is sent. | CustomEvent<Omit<NylasSchedulerBookingData, "additionalFields"> & { additionalFields?: Record<string, string> | undefined; }> |
emailChanged | This event is fired when the email is changed. | CustomEvent<string> |
nameChanged | This event is fired when the name is changed. | CustomEvent<string> |
Shadow Parts
Part | Description |
---|---|
"nbf" | The booking form host. |
"nbf__button-ghost" | The ghost button. |
"nbf__button-outline" | The outline button. |
"nbf__button-primary" | The primary button. |
"nbf__checkbox-component" | The checkbox component. |
"nbf__dropdown" | The dropdown component. |
"nbf__dropdown-button" | The dropdown button. |
"nbf__dropdown-content" | The dropdown content. |
"nbf__input-textfield" | The input textfield. |
"nbf__input-wrapper" | The input wrapper. |
"nbf__radio-button-group" | The radio button group. |
"nbf__textarea-component" | The textarea component. |
Built with StencilJS