Adjust to your needs
Add to Calendar Button Configuration
The following list holds all potential attributes to set up and customize your next Add to Calendar Button.
Check the Demo to play with most of them and explore the examples pages for more extensive descriptions for specific cases.
To specify a boolean value within the HTML custom element, you would only add the name as attribute.
Not setting it would automatically reflect to "false". As an alternative, you could also always write it as a string like attributeName="true".
PRO parameters
| Name(Value) | Value | Details |
|---|---|---|
| prokey | StringPRO only | If you are using the PRO service, you can use the "prokey" attribute to connect the button to a specific event of yours. |
| group-overview | BooleanPRO only | If an event group is configured for both subscription and an event list, it defaults to the subscription button. Use this attribute to show the event list instead. |
| group-overview-config | ObjectPRO only | Optional settings for
|
Event parameters
| Name(Value) | Value | Details |
|---|---|---|
| name | StringRequired | The title of your event. Should be a rather short string. |
| description | String | Supports HTML pseudo tags for formatting: [url], [br], [hr], [p], [strong], [u], [i], [em], [li], [ul], [ol], [h*] (like h1, h2, h3, ...). (In case of compatibility issues, you can use curly {} instead of square [] brackets here.) (Apple, Yahoo, and Microsoft Teams are not fully supported and automatically transformed to plain text, supporting only line breaks and hyperlinks.) |
| start-date | StringRequired, if not using "dates" or "subscribe" optionYYYY-MM-DD | A date needs to be formatted as YYYY-MM-DD as specified with ISO-8601. You can use the magic word "today" to dynamically set the current day. Adding "+5" at the end would automatically add 5 days to the calculated date. Unofficially, something like "YYYY-MM-DDTHH:MMZ" would also work. |
| start-time | StringHH:MM | If not set, the event will be defined as "all-day". |
| end-date | StringYYYY-MM-DD | A date needs to be formatted as YYYY-MM-DD as specified with ISO-8601. If there is no end-date set, it is assumed that it is the same as start-date. You can use the magic word "today" to dynamically set the current day. Adding "+5" at the end would automatically add 5 days to the calculated date. Unofficially, something like "YYYY-MM-DDTHH:MMZ" would also work. |
| end-time | StringHH:MM | If not set, the event will be defined as "all-day". |
| time-zone | StringDefault: GMT | It is not required, but recommended to add a time zone. You can use "currentBrowser" as value to dynamically use the time of the user's browser. Use this with caution, since it would mean that the time for the event will differ per user, which should not be the usual case. |
| use-user-tz | BooleanDefault: False | This option would transform time and time zone to the respective user's settings. If you set this option to "true", the time would be transformed to the user's time zone. |
| location | StringRequired, if you want Schema.org rich data | Can be anything. If it is a URL, the event will be classified as "online event" via the schema.org declaration. |
| status | StringOptions: tentative, confirmed, cancelledDefault: confirmed | Can be used to manage changes of an event as it is specified within the iCalendar specifications RFC5545. |
| sequence | NumberDefault: 0 | Needs to be a positive integer number. |
| availability | StringOptions: busy, freeDefault: Default setting at the user's calendar | Per default, the event will be marked as busy/free/available based on the user's calendar settings. |
| uid | StringXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXDefault: Randomly generated | The unique ID of the event as it is used within the iCal file. May only contain alpha, digits, and dashes; and be less than 255 characters. |
| organizer | StringNAME|EMAIL | Use the schema "NAME|EMAIL" (e.g. "John Doe|john.doe@gmail.com"). The organizer will appear within the schema.org rich data as well as the iCal file. |
| attendee | StringNAME|EMAIL | Use the schema "NAME|EMAIL" (e.g. "John Doe|john.doe@gmail.com"), or email only as the name is optional. Only 1 attendee can be specified When you specify an attendee, you also need to specify an organizer. |
| dates | Array of Objects | If you want to define an event series, you can use the dates object. It basically holds the same date structure as the root level, but enables you to define multiple events. Root level values override values in the dates object - except for the name if there are multiple dates (then, the root name will become the title of the event series). There is one special case with the "UID", which only uses the root level information for the first sub-event (since it needs to be unique). All subsequent sub-events will receive randomly generated new UIDs. Attributes per sub-event block:
|
| recurrence | StringOptions: "RRULE:..."; daily, weekly, monthly, yearly | Defines recurring events. This will deactivate the Yahoo and Microsoft (and Google at iOS) options, since they do not support it at the moment (users could still use iCal in this case). If no option is left then, iCal will be set as fallback. You can use any valid RRULE except for BYHOUR, BYMINUTE, and BYSECOND to define the respective rule (click here for a generator). As an alternative to the RRULE, you could also specify the following more specific reccurence settings, which will then generate the RRULE for you in the background (see next parameters). |
| recurrence-interval | NumberDefault: 1 | Defines the interval between iterations. |
| recurrence-until | StringYYYYMMDDTHHMMSSZ | Defines an end date. |
| recurrence-count | Number | Defines an upper limit of repetitions. |
| recurrence-by-day | String | Defines the weekdays (MO, TU, WE, TH, FR, SA, SU), where the even occurs (if, for example, it is bound to Tuesday instead of the 24th). |
| recurrence-by-month-day | String | Use this instead of the "byDay" option, if you want use a numbered day (1, 2, ... 31) instead of a weekday. |
| recurrence-by-month | StringOptions: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 | Defines the months (1, 2, 3, ... 12), where the event should happen. |
| recurrence-weekstart | StringOptions: MO, TU, WE, TH, FR, SA, SUDefault: MO | Specify a specific weekday as start of the week. |
| subscribe | BooleanDefault: False | As an alternative to providing a specific predefined event, you can also host a calendar and offer it for subscription (requires a hosted calendar). "Name" and "start-date" would be still required for organizational purposes, but every other event parameter can be skipped in the subscription case. If the user's browser does not recognize any installed calendar app, this might lead to a blank screen. The PRO version mitigates this with some explenatory middleware screen. |
| ics-file | StringURL | The iCal/ics file gets created dynamically. In the subscription case, you need to define the external calendar here. If you have multiple dates and an organizer or status set, you would need to prepare multiple ics files, where the one for the first date is specified here, while all subsequent dates look for a file with the same name and a number (starting with 2) appended (e.g. "event-2.ics"). |
| ical-file-name | StringDefault: event-to-save-in-my-calendar | If you want to define a specific name for any generated ics file (iCal), you can specify it via the ical-file-name option. |
ics file options
These options only shape the generated ics file - they apply to the "apple" and "ical" calendar types; every other type simply ignores them (no error, no dropped option).
All of them except "ics-exdate" can also be set per date entry within the multi-date "dates" array (root-level values override entry values, like the other date fields).
| Name(Value) | Value | Details |
|---|---|---|
| ics-reminder | String / Number | Adds a reminder alarm. Set the minutes before the event start (like |
| ics-url | String | Attaches a canonical link (the URL property) to the event. Needs to be a valid http(s) url. |
| ics-categories | String / Array | Tags the event with a comma-separated list of categories. |
| ics-class | StringOptions: public, private, confidential | Sets the event classification. |
| ics-priority | NumberOptions: 0 - 9 | Sets the priority from 0 (undefined) over 1 (highest) to 9 (lowest). |
| ics-geo | Stringlatitude,longitude | Adds geo coordinates. Combined with the regular "location" option, Apple Calendar renders its map preview. |
| ics-attach | String / Array | Attaches files by url (a comma-separated list of http(s) urls) - like an agenda PDF or a ticket. |
| ics-exdate | String / ArrayYYYY-MM-DD | Excludes dates from a recurring event (a comma-separated list of dates). Requires the "recurrence" option and is the only one of these options that cannot be set per date entry. |
| ics-created | StringYYYYMMDDTHHMMSSZDefault: Time the file gets downloaded | The "Created" field in the iCal file would default to the time the file gets generated and downloaded. Should be a UTC timestamp like "20231201T103000Z". |
| ics-updated | StringYYYYMMDDTHHMMSSZDefault: Time the file gets downloaded | The "Updated" field in the iCal file would default to the time the file gets generated. Should be a UTC timestamp like "20231201T103000Z". |
Layout parameters
| Name(Value) | Value | Details |
|---|---|---|
| options | ArrayOptions: apple, google, ical, ms365, msteams, outlookcom, yahoo | Array of options to use in the list. If you only specify 1 calendar type, the button would show the calendar's icon instead of the default one and redirect directly instead of opening a list (singleton case). Some options might be dynamically excluded based on other settings! You can specify a different set of options for mobile devices via the options-mobile option. If you also set the options-ios option, this will account for iOS (not Mac!), while options-mobile accounts for Android and other mobile devices. |
| button-style | StringOptions: default, simple, 3d, flat, round, neumorphism, text, date, custom, noneDefault: default | There are multiple integrated button styles, which also affect a lot of other parameters. "none" would simply load no css style at all, while "custom" requires an external css file specified with the "custom-css" option. Only the default style is part of the script itself - every other style loads automatically on demand (a few KB), or fetch-free via |
| inline | BooleanDefault: False | Renders the button inline instead of the default block style. |
| custom-css | StringURL | You can load an external css file instead of using and customizing the integrated one. |
| style-source | StringURL | Overrides the base url from which on-demand assets (button styles beyond the default, language packs beyond English) are loaded. By default, they load from wherever the script itself is hosted. Set this option if you self-host the script in an exotic setup or want to serve the assets from a dedicated location. The url should point at the directory that contains the |
| load-all-styles | BooleanDefault: False | Prefetches every button style delta on initialization. Only useful when you switch the "button-style" at runtime (for example in a live theme switcher) and want the change to apply without any network delay. This option only works when using the button via a script tag, not via the npm package. With npm, import the required style modules instead - or |
| buttons-list | BooleanDefault: False | Renders one button per calendar type instead of the button + list. |
| label | StringDefault: Add to Calendar | This option overrides the text at the button. |
| trigger | StringOptions: hover, clickDefault: hover | The dropdown or overlay list unfolds on hover per default in most cases. |
| list-style | StringOptions: dropdown, dropdown-static, dropup-static, overlay, modalDefault: dropdown | The calendar link list can be rendered as dropdown, overlay, or modal. The dropdown style also considers the position of the button on the screen and shows the list automatically above or below the button. Use "dropdown-static" or "dropup-static" to always open below or above the button. |
| force-overlay | BooleanDefault: False | This option renders the dropdown together with the button above everything else - similar to the modal option. However, it comes with some small performance drawbacks. |
| hide-background | BooleanDefault: False | With this option, you get a fully transparent background instead of the darker blurry one. |
| hide-icon-button | BooleanDefault: False | This option hides the icon at the button. |
| hide-icon-list | BooleanDefault: False | This option hides the icons at the calendar link list. |
| hide-icon-modal | BooleanDefault: False | This option hides the heading icon at any info modal. |
| hide-text-label-button | BooleanDefault: False | This option hides the text label at the button. |
| hide-text-label-list | BooleanDefault: False | This option hides any text at the calendar link list. |
| hide-checkmark | BooleanDefault: False | Clicking a calendar link marks the event as "saved" by adding a checkmark icon. |
| past-date-handling | StringOptions: none, disable, hideDefault: none | This option specifies what happens, if an event is overdue. Mind that with recurring events, this will not get triggered! |
| size | StringX|X|XDefault: 6|6|6 | Specify a number between 0 and 10 to scale the button. You can define 1 number like "5" or up to 3 values like "8|6|4", where the first one will apply to large, the second to medium, and the third to small screens. |
| light-mode | StringOptions: system, dark, light, bodySchemeDefault: light | Each button comes with a dark and light mode. Set the option light-mode to "dark" or "light" explicitly, or use "system" to automatically adapt to the user's default setting. |
| language | StringOptions: ar, az, be, bg, bs, cs, da, de, el, en, es, et, fa, fi, fr, he, hi, hr, hu, hy, id, it, ja, ka, ko, lt, lv, mk, mt, nb, nl, nn, no, pl, pt, pt_BR, ro, ru, sk, sl, sq, sr, sr_latin, sv, tr, uk, vi, zh, zh_hantDefault: en | Selects included translations. Base languages use ISO 639-1 codes and RTL is supported. English is built in; others load on demand or via locale imports. Full locales such as |
| custom-labels | Object | Overrides all text blocks using a JSON object with flattened locale keys such as |
| style-light | String | You can override global css variables for the button. See the CSS files in the repository. Example: |
| style-dark | String | You can override global css variables for the button. Find out what you can change by having a look at the top section at a respective css file in the repository. |
Additional parameters
| Name(Value) | Value | Details |
|---|---|---|
| images | ArrayURLs | Images enrich schema.org data. Define at least one absolute URL with 720px width; ideally three 1920px images in 1x1, 4x3, and 16x9. |
| hide-rich-data | BooleanDefault: False | If you set at least a name, start-date, and location, the script automatically generates schema.org rich data when rendering a button. Setting this option would disable the feature. |
| identifier | StringDefault: Ascending number | Each generated button and calendar link has a speaking ID for tracking: "atcb-btn-IDENTIFIER" or "atcb-btn-IDENTIFIER-google". IDENTIFIER defaults to an ascending number and can be overridden (unique, no special characters). |
| bypass-web-view-check | BooleanDefault: False | On iPhone WebViews, ics downloads cannot be offered directly, so instructions are shown. Bypass only in your own app when downloads open in the default browser and ics-file is explicitly provided. |
| hide-branding | BooleanDefault: False | Per default, there is a slight branding to support this free open-source project. This option removes it while complying with the license. |
| cspnonce | String | Adds a "nonce" attribute with the provided value to all inline script and style tags for strict Content-Security-Policy environments. |
| instance | Number | Use this attribute to force a re-rendering of the button by counting its value 1 up. |
| pro-override | BooleanDefault: False | With this option enabled, any setting would override its corresponding one from the PRO app. Use with caution, as this can lead to inconsistencies across systems! |
| debug | BooleanDefault: False | Setting this option would put any misconfiguration into the browser's JavaScript console and also render an error instead of the calendar. Helpful while implementing the button for the first time. |