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
installation
bunx @justin06lee/chrome@latest add add-to-calendarprops
| name | type | default | description |
|---|---|---|---|
| event * | CalendarEventInput | - | { title, start, end, description?, location?, url?, uid? } — start/end are epoch ms. |
| targets | CalendarTarget[] | ['google', 'outlook', 'office', 'ics'] | which destinations to offer, in order. 'yahoo' is also available. |
| icsHref | string | - | 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. |
| filename | string | 'invite.ics' | |
| label | ReactNode | 'add to calendar' | |
| variant | 'menu' | 'inline' | 'menu' | 'inline' lays the targets out as a row of buttons. |
| className | string | - |