Skip to main content

DayStrip

Every example on this page is live, drawn by the library's Storybook, where you can also change its props and see the result.

A row or column of upcoming days, such as a weather forecast, with each day's name, a value, an optional second line and an optional icon. With unit="hour" it lays out the hours of a day the same way, each named by its time on the clock.

Import​

import { DayStrip } from "~lib/data-display/day-strip";

Props​

NameTypeRequiredDefaultDescription
days{ date: Date | string | number; primary: string; secondary?: string; icon?: ReactNode }[]YesN/AThe days to show, in order
direction"row" | "column"No"row"Days side by side, or one under another
dayFormat"short" | "long"No"short"Mon or Monday
unit"day" | "hour"No"day"Name each entry by its weekday, or by its hour on the clock
timeFormat"24h" | "12h"No"24h"With unit="hour", 14:00 or 2 PM
timeZonestringNoFrame time zoneTime zone the days are named in, such as "Europe/London"
localestringNoFrame languageLanguage of the day names, such as "fr-FR"
size"sm" | "md" | "lg"No"md"Text size
dividerbooleanNofalseDraw a thin line between days

Each day's date can be:

  • a date written as "2026-10-05", which always shows as that day, wherever the frame is
  • a Date, a timestamp string or milliseconds since 1970, which shows as the day it falls on in timeZone

Long text is cut short with "…" rather than wrapping, so the strip keeps its size.

Hours​

unit="hour" names each entry by its hour, 14:00 or with timeFormat="12h" 2 PM, and an entry off the hour with its minutes too (14:30). Give it the same entries, one per hour:

  • a time written with no zone, such as "2026-10-05T14:00" (the way forecast services give the hours of the place you asked about), always shows as that hour, wherever the frame is
  • a Date, a timestamp with an offset or milliseconds since 1970 shows as the hour it falls on in timeZone

dayFormat and locale only change day names.

Open Hours in Storybook
Open Hours Twelve Hour Clock in Storybook

Examples​

Row​

Days side by side in equal columns.

Open Row in Storybook

Thin Band​

A small row for a wide, short widget.

Open Band in Storybook

Column​

One day per row, for a tall widget.

Open Column in Storybook

Long Day Names​

Open Long Day Names in Storybook

Without Icons​

Open No Icons in Storybook

With Dividers​

Open With Divider in Storybook
Open Column With Divider in Storybook

Example Widget​

import { DayStrip } from "~lib/data-display/day-strip";
import { Icon } from "~lib/icon";

const Forecast = ({ days }) => (
<DayStrip
days={days.map((day) => ({
date: day.date, // e.g. "2026-10-05"
primary: `${day.high}° / ${day.low}°`,
secondary: `Rain ${day.rainChance}%`,
icon: <Icon name={day.condition} size={40} />,
}))}
/>
);

See Also​

  • Icon - Weather icons for each day
  • KeyValue - A list of labelled values
  • Table - Rows and columns of data