How to install the Add to Calendar Button with React

Since React 19, web components are fully supported out of the box - no wrapper or workarounds needed. Simply use the Add to Calendar Button web component directly in your JSX.

We will highlight all options below.

Step 1: npm installation

Install the package from the npm registry.

npm install add-to-calendar-button

Step 2: Import it

Import the module into the component, where you want to use the button.

import 'add-to-calendar-button';

Step 3: Use it

Start using it by adding a <add-to-calendar-button> tag to your HTML source code - with the options as attributes.

With React 19, custom element properties can be typed via TypeScript's custom elements support. Register the element type once (e.g. in a global.d.ts) to get full type checking:

import type {
  AddToCalendarButtonType,
} from 'add-to-calendar-button';
import type {
  DetailedHTMLProps,
  HTMLAttributes,
} from 'react';

declare module 'react' {
  namespace JSX {
    interface IntrinsicElements {
      'add-to-calendar-button': DetailedHTMLProps<
        Omit<HTMLAttributes<HTMLElement>, keyof AddToCalendarButtonType>,
        HTMLElement
      > &
        AddToCalendarButtonType;
    }
  }
}

export {};

If compilerOptions.types is set in your tsconfig, include react and react-dom alongside any existing entries:

{
  "compilerOptions": {
    "types": ["vite/client", "react", "react-dom"]
  }
}

Your code block could look like the following.

<add-to-calendar-button
  name="Title"
  options="'apple','google'"
  location="World Wide Web"
  start-date="2026-10-03"
  end-date="2026-10-03"
  start-time="10:15"
  end-time="23:30"
  time-zone="EST"
></add-to-calendar-button>

Mind that the button only works on the client side! Add 'use client'; respectively.

Styles & languages

The script ships with the "default" button style and the English language pack built in - so the button looks great and works out of the box without any extra configuration.

When you load the browser script directly, every other style and language loads automatically on demand (a few KB each). Bundled integrations should register the required modules explicitly as shown below.

Bundling via npm (recommended for frameworks)

When you bundle the script, import the style and language modules you need before the main module. This registers them fetch-free before the custom element upgrades, including during SSR hydration:

import 'add-to-calendar-button/styles/3d';   // any style besides "default"
import 'add-to-calendar-button/i18n/de';       // any language besides English
import 'add-to-calendar-button';             // load the component last

To load all styles or all languages in one statement, use the aggregate modules: import 'add-to-calendar-button/styles/all' and import 'add-to-calendar-button/i18n/all'.

See the "button-style" and "language" options at the Configuration page for the full picture.

Get blown away by the PRO offering

Discover the PRO offering

More functionality (like RSVP) and way less trouble thanks to managed ics file hosting, no-code customization, and more.


Definition | Legal Notice | Privacy Policy | Migration guide v2→v3 | License | Help
© 2026 Calendarverse GmbH, Current Version: 3.3.0