nylas-timeslot-picker

Overview

The nylas-timeslot-picker component is a UI component that allows users to select a timeslot from a list of available timeslots.

Version1.1.4
Install (React)npm install @nylas/react
Import (React)import { NylasTimeslotPicker } from '@nylas/react';
Import (CDN)<script type="module"> import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/nylas-timeslot-picker/nylas-timeslot-picker.es.js"; defineCustomElement(); </script>

Example


Properties

PropertyAttributeDescriptionTypeDefault
selectedDateThe selected date.Date | undefinednew Date()
selectedLanguageThe selected language.string | undefinedundefined
selectedTimeslotThe selected timeslot.undefined | { start_time: Date; end_time: Date; emails?: string[] | undefined; }undefined
selectedTimezoneThe selected timezone.stringIntl.DateTimeFormat().resolvedOptions().timeZone

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.
PropertyAttributeDescriptionTypeDefault
availabilityThe available timeslots.AvailabilityTimeslot[] | undefinedundefined
isLoadingThe loading state prop. Used to display loading state when fetching availability.boolean | undefinedundefined

Events

EventDescriptionType
timeslotConfirmedThis event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.CustomEvent<{ start_time: Date; end_time: Date; emails?: string[] | undefined; }>
timeslotSelectedThis event is fired when a timeslot is selected.CustomEvent<{ start_time: Date; end_time: Date; emails?: string[] | undefined; }>

Slots

SlotDescription
"timeslot-picker-cta-label"The label for the timeslot picker CTA. Default is “Next”.

Shadow Parts

PartDescription
"ntp"The timeslot picker component.
"ntp__button-primary"The timeslot picker CTA.
"ntp__timeslot"The timeslot button.
"ntp__timeslot--selected"The selected timeslot button.

Built with StencilJS