components / add-to-calendar

add-to-calendar.

"add to calendar" for a confirmed booking: google, outlook, office 365 and yahoo as links, plus a generated .ics for everything else. the ics is built in-component (rfc 5545 folding and escaping included) so it works with no backend; icsHref overrides it when the server owns the canonical file. exports buildIcs and calendarUrl.

menu
inline
google calendar
installation
bunx @justin06lee/chrome@latest add add-to-calendar
props
nametypedefaultdescription
event *CalendarEventInput-{ title, start, end, description?, location?, url?, uid? } — start/end are epoch ms.
targetsCalendarTarget[]['google', 'outlook', 'office', 'ics']which destinations to offer, in order. 'yahoo' is also available.
icsHrefstring-serve the .ics from your own route instead of the generated blob — use it once an invite has been emailed and the uid has to match.
filenamestring'invite.ics'
labelReactNode'add to calendar'
variant'menu' | 'inline''menu''inline' lays the targets out as a row of buttons.
classNamestring-