DocumentationAdd to Calendar button

Add to Calendar button

Drop a button on any website and visitors add your event to their calendar in one click. There are two ways to use it: point it at an event you already created in AddCal, or drive it with a Smart Link and put the event details right in the HTML.

Live preview

This is a real button rendered with the snippet below. Click it to see the calendar chooser.

Button for an existing event

If you have already created the event in AddCal, point the button at it with data-event. This is the simplest button, the easiest way is to copy the ready-made snippet from the event's Share page in your dashboard.

Event button
<div class="addcal-btn" data-event="evt_abc123" data-base="addcal.co"></div>
<script src="https://cdn.addcal.co/embed/1.6.0/button.min.js" async defer></script>
ParameterRequiredDescription
data-eventRequiredThe event to add. Use the event's identifier from AddCal.
data-baseRequiredYour AddCal domain, for example addcal.co, or your custom domain on Business.
data-themeOptionalThe button theme: default, light, iconlist, or buttonlist. Defaults to default.
data-btn-textOptionalCustom button label. Applies to the default and light themes.
data-colorOptionalCustom button background as a hex value like #7C3AED. Text colour is auto-chosen for contrast.
data-calendarsOptionalComma-separated allow-list of calendar services to show, in order, for example google,apple.
On a website builder like Wix, Squarespace, or Webflow, paste this inside an HTML or embed block. No coding required.

Button from a Smart Link

To set the event details right in the HTML, drive the button with a Smart Link instead. Use data-smart-link-key and add the event details as child spans. Include the script once per page.

HTML
<style>.addcal-btn span{display:none}</style>
<div class="addcal-btn"
  data-base="addcal.co"
  data-smart-link-key="your-key"
  data-theme="default">
  <span class="title">Team Meeting</span>
  <span class="start">2026-05-24T15:00:00</span>
  <span class="end">2026-05-24T16:00:00</span>
  <span class="timezone">America/New_York</span>
  <span class="description">Weekly team sync.</span>
  <span class="location">Conference Room A</span>
  <span class="is_all_day">false</span>
</div>
<script src="https://cdn.addcal.co/embed/1.6.0/button.min.js" async defer></script>

Smart Link button attributes

These attributes go on the addcal-btn element.

ParameterRequiredDescription
data-baseRequiredYour AddCal domain, for example addcal.co, or your custom domain on Business.
data-smart-link-keyRequiredThe key of the Smart Link this button creates events through.
data-themeOptionalThe button theme: default, light, iconlist, or buttonlist. Defaults to default.

Event details

For a Smart Link button, event details are child span elements, each with a class naming the field.

ParameterRequiredDescription
titleRequiredEvent title, up to 255 characters.
startRequiredStart date and time in ISO format.
endConditionalEnd date and time. Use this or duration unless the event is all-day.
durationConditionalEvent length in minutes. Used when you omit end.
timezoneOptionalIANA timezone like America/New_York.
locationOptionalPhysical address or virtual meeting link.
descriptionOptionalA longer description of the event.
is_all_dayOptionaltrue for an all-day event, otherwise false.
Provide either end or duration, unless the event is all-day.

Your own button (headless)

Want full control over the look? Bring your own element. Keep the addcal-btn class and the target attribute (data-event or data-calendar), add data-addcal-headless, and put your own clickable element inside. AddCal wires up the calendar chooser and leaves all the styling to you.

Headless button
<div class="addcal-btn" data-event="evt_abc123" data-base="addcal.co" data-addcal-headless>
  <button class="my-button">Add to my calendar</button>
</div>
<script src="https://cdn.addcal.co/embed/1.6.0/button.min.js" async defer></script>
Keep the addcal-btn class and a target attribute (data-event or data-calendar). Without them, the button cannot attach.