Skip to content
New

Hours, week

beta

The week's opening hours, one or more slots a day, today highlighted and a live 'open now' in the business's time zone.

npx rasengan-ui add hours-week

Opening hours

Monday
Closed
Tuesday
11:30 – 15:0018:30 – 23:00
Wednesday
11:30 – 15:0018:30 – 23:00
Thursday
11:30 – 15:0018:30 – 23:00
Friday
11:30 – 0:30
Saturday
11:30 – 0:30
Sunday
12:00 – 17:00

Closed on 1 January and 20 May. The kitchen takes its last orders 30 minutes before closing.

Use it
Any place people visit: restaurants, shops, salons, clinics.
Avoid it
Hours by appointment only: say so in a contact block.
Built with
Badge

Installation

Terminal
npx rasengan-ui add hours-week

It installs into components/blocks/hours-week/, with what it uses (Badge) and lib/blocks.ts.

Usage

Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):

app/_routes/index.page.tsx
import { HoursWeek } from "@/components/blocks/hours-week";
import { home } from "@/content/home";
 
export default function Home() {
  return <HoursWeek content={home.hours} />;
}
content/home.ts
import { example, type HoursWeekContent } from "@/components/blocks/hours-week";
 
export const home = {
  hours: {
    ...example,
    title: "When to find us",
  } satisfies HoursWeekContent,
};

Slots that close after midnight ({ open: "18:30", close: "00:30" }) count for the next day too. "Open now" and today's highlight use timeZone, the business's, not the visitor's; they appear once the page has read the clock, so the prerendered HTML and the hydrated page agree.

Content

FieldTypeLimitsGuidance
titlestring2–48 chars'Opening hours', 'When to find us'.
hoursobject
hours.daysobject[]1–7 items
hours.days[].day"monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"
hours.days[].slotsobject[]≤ 3 itemsEmpty for a closed day.
hours.days[].slots[].openstring24-hour 'HH:MM'.
hours.days[].slots[].closestring24-hour 'HH:MM'.
hours.noteoptionalstring≤ 120 charsHolidays, exceptions.
timeZonestring≥ 3 charsThe business's IANA time zone, for 'open now': 'Africa/Douala'.
localeoptionalstringA BCP 47 locale for day names and times ('en-CM'); the page's language when left out.
labelsobjectShown by day and by the live status, which appears once the page has read the clock.
labels.closedstring1–24 chars'Closed'
labels.todaystring1–16 chars'Today'
labels.openNowstring1–24 chars'Open now'
labels.closedNowstring1–24 chars'Closed now'

Props

PropNotes
contentHoursWeekContent; the example when left out
idthe section's id, for anchor links; "hours" by default
headingLevel1, 2 or 3: the heading's tag; 2 by default
classNameon the <section>, for spacing

Accessibility

  • The week is a description list: each day (dt) with its slots (dd).
  • Day names and times follow locale.