Skip to main content

Menu

Choose a theme and configure high-contrast mode. Preferences are saved in your browser only.

User Preferences

Theme

Pick a palette or follow your system preference.

High Contrast

Sharper text and borders. System follows your OS setting.

Version 1.0.0

What’s new

First stable release of TwistCal — a lightweight, zero-dependency “Add to Calendar” web component with Shadow DOM.

Three usage modes

  • Web component<twist-cal> renders a styled dropdown button with Google, Outlook, Yahoo, and .ics
  • Declarative triggersdata-twistcal attributes on any element, auto-initialized
  • Programmatic API — import URL generators and ICS builder directly

Features

  • Shadow DOM style isolation — styles don’t leak in or out
  • 12 languages with auto-detection from lang attribute, <html lang>, or navigator.language
  • Button variantssolid (default) and outline (white bg, dark border)
  • Calendar selectioncalendars="google,ics" to pick which services to show and in what order
  • Icon togglesshow-icons (dropdown) and show-icon (button), both on by default
  • Brand SVG icons — Google Calendar (classic “31”), Outlook, Yahoo, Apple Calendar
  • Full CSS theming — 25+ --tc-* custom properties for every visual value
  • Slim builds — no icons, drops ~8 KB (19 KB → 11 KB)
  • Generators splitsrc/generators.js importable without the web component (3 KB)
  • TypeScript declarations.d.ts for full and generators builds
  • All-day eventsall-day="true" attribute, date-only ICS and Google/Yahoo formats
  • Event callbacktwistcal:add CustomEvent with { action, event } detail
  • Custom calendar servicesaddCalendar(id, label, icon, urlFn) API
  • Keyboard navigation — ArrowUp/Down, Home/End, Escape, auto-focus first item
  • Branding — “Powered by TwistCal” link in dropdown, branding="false" to hide
  • Calendar icon on the button, using currentColor, baked into all builds
  • Timezone support — DST-aware via Intl.DateTimeFormat, IANA names
  • JSON event data<script type="application/json"> inside <twist-cal>

Build variants

File Format Size Icons Languages
dist/twistcal.min.js IIFE 19 KB Yes All 12
dist/twistcal.slim.min.js IIFE 11 KB No All 12
dist/twistcal.esm.min.js ESM 19 KB Yes All 12
dist/twistcal.slim.esm.min.js ESM 11 KB No All 12
dist/twistcal.{lang}.min.js IIFE 17 KB Yes Single lang
dist/twistcal.{lang}.slim.min.js IIFE 9 KB No Single lang
dist/twistcal.generators.esm.min.js ESM 3 KB

CDN

All CDN links use jsdelivr:

<script defer src="https://cdn.jsdelivr.net/npm/@freshjuice/twistcal/dist/twistcal.min.js"></script>

License

Apache-2.0 © FreshJuice