FlipOptionstype
What flipCalendar takes: how to draw a date, the two dates, and how the page turns.
Import it
import type { FlipOptions } from "@johnmorrisdotca/koyomi-calendars/animate";
Definition
interface FlipOptions {
render: (date: FlipDate) => string;
from: FlipDate;
to: FlipDate;
animation?: CalendarFlip;
duration?: number;
motion?: "auto" | "never" | "always";
}
Members
| Name | Type | Description |
|---|---|---|
render | (date: FlipDate) => string | Draws a date: it returns the SVG of an icon. |
from | FlipDate | The date the host shows now. |
to | FlipDate | The date to turn to. Later than |
animation (optional) | "tear-down" | "fly-up" | "rip-corner" | "flip-down" | undefined | |
duration (optional) | number | undefined | Milliseconds. Default 650. |
motion (optional) | "auto" | "never" | "always" | undefined |
|
Examples
import { calendarIcon } from "@johnmorrisdotca/koyomi-calendars";
import type { FlipOptions } from "@johnmorrisdotca/koyomi-calendars/animate";
const options: FlipOptions = {
render: (date) => calendarIcon({ theme: "pins", ...date }),
from: { year: 2026, month: 11, day: 3 },
to: { year: 2026, month: 11, day: 4 },
animation: "fly-up",
};
console.log(options.animation);fly-upWhat it prints (run when this page was built)