Almanac Day Card
Taiwan almanac day card: big Gregorian date with the lunar date, auspicious do/avoid lists, clash zodiac and lucky hours, with a tear-off page-flip animation between days
This is a WebberUI Pro component
The install command below needs a licence to run; without one it returns 401.
A digital version of the red farmer's almanac hanging on Taiwanese family walls: a vertical calendar page with an accent-colored month bar and tear-off perforation holes, a big Gregorian day number (weekends turn red automatically), the lunar date with sexagenary cycle and zodiac, a festival badge, two columns of Auspicious|Inauspicious (do/avoid) tags, and clash and lucky-hour rows at the bottom. Switching days tears the whole page off along the perforation while the new page surfaces from behind — great for calendar, wedding, fortune-telling, and temple sites. All data comes in through props; the component does no perpetual-calendar maths — wire up your own data source, or generate the lunar fields with lunar-date-picker.
Bring this into your project
Run this command in your project folder. The CLI adds the source and dependencies; then follow the usage example below.
npx webberui@latest add "https://webberui.com/r/almanac-day-card.en.json?t=<install token>"Playground
Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.
<AlmanacDayCard/>
The complete example includes the preview layout and data. Install the component first, then paste this file into your project.
Installation
npx webberui@latest add "https://webberui.com/r/almanac-day-card.en.json?t=<install token>"Or, once registries are configured in components.json, install it as @webberui/almanac-day-card.
Usage
import {
AlmanacDayCard,
type AlmanacDay,
} from "@/components/ui/almanac-day-card";
// Data comes from your own source (values here are illustrative, not from a real almanac)
const day: AlmanacDay = {
date: "2026-08-19",
lunar: {
monthName: "July",
dayName: "Seventh Day",
ganzhi: "Year of Bingwu, Month of Bingshen, Day of Wuwu",
zodiac: "Horse",
},
suitable: ["Marriage", "Betrothal", "Visiting Relatives and Friends", "Signing Contracts"],
avoid: ["Breaking Ground", "Building a Stove", "Digging a Well"],
clash: "Clashes with Rat (Renzi), unfavorable direction: North",
luckyHours: ["Yin Hour 3-5", "Si Hour 9-11", "Wu Hour (11 AM - 1 PM) 11-13"],
festival: "Qixi Festival",
};
<AlmanacDayCard
day={day}
onPrev={() => goTo(-1)}
onNext={() => goTo(1)}
/>;Props
| Prop | Type | Default | Description |
|---|---|---|---|
day | AlmanacDay | — | The full data for the day (see the sub-types below); the component does no calendar maths, the data is supplied from outside |
onPrev | () => void | — | Switch to the previous day; the left arrow only shows when this is provided |
onNext | () => void | — | Switch to the next day; the right arrow only shows when this is provided |
accent | string | "#b91c1c" | Accent color (header bar, do-tags, festival badge, and weekend digits); any valid CSS color |
compact | boolean | false | Compact mode with smaller type and spacing |
showLuckyHours | boolean | true | Whether the lucky-hours row is shown |
maxItems | number | 6 | How many do/avoid items to show per column before folding into a "+N" tag; 0 shows everything |
title | string | "Almanac" | Header title text (a shortcut for labels.title); the default means "farmer's almanac" |
labels | Partial<AlmanacLabels> | — | Overrides for the section heading texts |
className | string | — | Forwarded to the outermost container |
AlmanacDay
| Field | Type | Default | Description |
|---|---|---|---|
date | string | — | Gregorian date in ISO YYYY-MM-DD format |
lunar | AlmanacLunar | — | The lunar date information |
suitable | string[] | — | Auspicious activities (Auspicious) — e.g. weddings, opening a business, moving in |
avoid | string[] | — | Activities to avoid (Inauspicious) |
clash | string | — | Clash line (Clash) — e.g. "Clash with Rat(Bingzi) conflictNorth" (clashes with Rat, inauspicious to the north) |
luckyHours | string[] | — | Lucky hours (Auspicious Time) — e.g. "Zi Hour (11 PM - 1 AM)" (Zi hour, 11pm–1am) |
festival | string | — | Festival name — e.g. "Qixi Festival" (Qixi); shows a badge when present |
AlmanacLunar
| Field | Type | Default | Description |
|---|---|---|---|
monthName | string | — | Lunar month name — e.g. "July" (the seventh month) |
dayName | string | — | Lunar day name — e.g. "Eighth Day" (the eighth day) |
ganzhi | string | — | Sexagenary cycle — e.g. "Bingwu Year, Bingshen Month Renzi day" |
zodiac | string | — | Zodiac animal — e.g. "Horse" (horse) |
AlmanacLabels
| Field | Type | Default | Description |
|---|---|---|---|
title | string | "Almanac" | Header title (farmer's almanac) |
suitable | string | "Auspicious" | Do-column heading (auspicious) |
avoid | string | "Inauspicious" | Avoid-column heading |
clash | string | "Clash" | Clash-row heading |
luckyHours | string | "Auspicious Time" | Lucky-hours-row heading |
The AlmanacDay, AlmanacLunar, and AlmanacLabels types are also named exports, so the data can be assembled at the data layer before being passed in.
How it works
- No calendar maths: lunar conversion and the do/avoid and clash rules differ between almanac publishers, so the component deliberately only renders — all data comes through the
dayprop. To convert lunar dates automatically, wire up your own data source or calendar library, or generate the lunar fields with this site'slunar-date-picker(which ships a 2026 lookup table) - The tear-off animation: moving forward a day, the old page folds down and away with
rotateXhinged on the perforation at the top, while the new page surfaces from behind; moving back a day runs in reverse — the new page springs back into place from the folded state, settling with a slight wobble, like sticking the torn page back on - Date parsing:
dateis parsed as a string (bypassing the timezone conversion ofnew Date(iso)), so the weekday and weekend checks give the same result on the server and the client, and the date never shifts by a day with the user's timezone - With a custom
accent, the tag and badge tints are derived from the accent viacolor-mix(), so light and dark themes need no extra configuration
Accessibility
- The whole card is a
role="group"whosearia-labelincludes the Gregorian and lunar dates; the do/avoid lists are semanticullists, with their column headings linked viaaria-labelledby - When
onPrevoronNextis provided the card is focusable, and ← / → switch days while it has focus; the arrow buttons carryaria-labels andfocus-visiblerings - On a day switch, the new date (including the lunar date and festival) is announced through an
aria-live="polite"region, so screen reader users do not need to re-read the whole card - When the user has "reduce motion" enabled at the system level, the tear-off fold and the staggered tag entrances are disabled in favor of a plain cross-fade
Taiwan Tile Map
A React tile-grid map of Taiwan's 22 counties and cities that needs no geo data: value-driven choropleth colouring, hover tooltip cards, click callbacks and arrow-key navigation, usable as a visual filter.
Taiwan Stock Quote Card
A Taiwan-convention stock quote card for React: red for up and green for down, limit-up/down locked styling, rolling flashing price digits, a change badge, open/high/low/previous-close cells, a volume bar and a compact 5-level order book — all data supplied via props.