Skip to content

“Add to calendar” button

A button that adds an event to Google Calendar, Outlook or any calendar through an .ics file, with no third-party service.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Under the page of a workshop, an appointment or a concert, the button opens a small menu with three choices: Google Calendar and Outlook.com open in a new tab with the title, time, place and description already filled in; the third downloads an .ics file in iCalendar format, recognised by Apple Calendar, Thunderbird, Proton or Android calendars. Everything is computed ahead in the links: no script or external service is needed, and the .ics file is embedded as a data URI. The menu is a native details element, usable with the keyboard and read correctly by screen readers; a few lines of script add closing with Escape (focus returns to the button) and with an outside click. Times are given in UTC to avoid any daylight-saving offset. 44 px targets, AA contrast in light and dark mode, a menu that does not overflow at 360 px, and an arrow animated only without prefers-reduced-motion.

Code

Loading the code…

The code of this component in

Archive contents

bouton-ajout-agenda-html-tailwind.zip3 files · 5 Ko

  • index.html6 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 3, 2026.

Reviews

No reviews yet.

In the same spirit

  • A row of buttons to share the page on Facebook, LinkedIn, WhatsApp or by email, with a copy-link button and no third-party script.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Toggle heart buttons that count favourites, remember them between visits and announce them to screen readers.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A button that copies an IBAN, a reference, an address or a promo code and confirms "Copied", on screen and to screen readers.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A WhatsApp button pinned to the bottom of the screen that opens a welcome bubble with common topics and a pre-filled message, with no third-party widget.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component