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 triggers —
data-twistcalattributes 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
langattribute,<html lang>, ornavigator.language - Button variants —
solid(default) andoutline(white bg, dark border) - Calendar selection —
calendars="google,ics"to pick which services to show and in what order - Icon toggles —
show-icons(dropdown) andshow-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 split —
src/generators.jsimportable without the web component (3 KB) - TypeScript declarations —
.d.tsfor full and generators builds - All-day events —
all-day="true"attribute, date-only ICS and Google/Yahoo formats - Event callback —
twistcal:addCustomEvent with{ action, event }detail - Custom calendar services —
addCalendar(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
