Add to Calendar links

Save the date, anywhere

Let users add your events to their calendar of choice in one click.

composer require symfony/ux-calendar-link
  • One-click add

    Visitors save your event without copying anything.

  • Every provider

    Google, Outlook, Yahoo and iCalendar files.

  • Recurring events

    Daily, weekly or custom repeat rules.

  • Timezone correct

    Dates land right wherever the visitor is.

  • One Twig function

    ux_calendar_links() returns every link.

One object, every calendar

Describe the event once.

A CalendarEvent carries the dates and everything optional around them. The Twig function turns it into one link per provider, and the buttons below are the real thing.

A simple event

Create a CalendarEvent with a title, a start and an end date, and optionally a location and a description.

Then call ux_calendar_links(event) in your Twig template to get one link per registered provider.

$event = new CalendarEvent(
    title: 'SymfonyCon Warsaw 2026',
    start: new \DateTimeImmutable(
        '2026-11-26 09:00', $timezone,
    ),
    end: new \DateTimeImmutable(
        '2026-11-27 18:00', $timezone,
    ),
    location: 'Hilton Warsaw Hotel',
);

Try the links it produces

A recurring, all-day event

For events that repeat on a fixed schedule, birthdays, public holidays, weekly team meetings, you do not want people adding them by hand every time.

Set allDay: true when the event spans the whole day, and pass a CalendarRecurrence to let the calendar handle the repetition.

Note

Recurrence is honored by Google Calendar and the .ics file only.

$event = new CalendarEvent(
    title: 'Victory in Europe Day',
    start: new \DateTimeImmutable(
        '2025-05-08', $timezone,
    ),
    end: new \DateTimeImmutable(
        '2025-05-09', $timezone,
    ),
    allDay: true,
    recurrence: CalendarRecurrence::yearly(),
);

Try the links it produces

An event with a reminder

Having the event in the calendar is a good start, but some appointments really need a heads-up.

Pass one or more CalendarReminder instances to warn people ahead of time: a day before, an hour before, whatever the event deserves.

Note

Reminders are honored by the .ics file only.

$event = new CalendarEvent(
    title: 'Blood donation',
    start: new \DateTimeImmutable(
        '2025-06-12 14:00', $timezone,
    ),
    end: new \DateTimeImmutable(
        '2025-06-12 15:00', $timezone,
    ),
    reminders: [
        CalendarReminder::before(
            days: 1,
            description: 'Eat and drink well.',
        ),
        CalendarReminder::before(
            hours: 2,
            description: 'Time to go!',
        ),
    ],
);

Try the links it produces

Install CalendarLink.

$ composer require symfony/ux-calendar-link

More from Symfony UX.

CalendarLink is one package among many. They share the same Stimulus foundation and install the same way.

Image for the Autocomplete UX package

Autocomplete

Ajax-powered, auto-completable select elements

Image for the Translator UX package

Translator

Use Symfony's translations in JavaScript

Image for the Router UX package

Router New

Generate your Symfony routes' URLs in JavaScript

Browse every package

Keep CalendarLink at hand.

Documentation, the people behind it, and where to ask when something does not behave.