Opening hours week rows — Settings block
Prosettings-opening-hours-week-rows · for app, settings pages
Opening hours week rows
A ruled row per day, its open switch and its ranges side by side, the exceptions listed under the week: the full settings page of a shop, a restaurant or a practice
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/settings-opening-hours-week-rowsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SettingsOpeningHoursWeekRows from '@/components/trame/blocks/settings/settings-opening-hours-week-rows.vue'
const props = {
title: "Opening hours",
intro: "Shown on your shop page and used for click-and-collect times.",
week: [
{
day: "mon",
ranges: []
},
{
day: "tue",
ranges: [
{
from: "07:30",
to: "13:00"
},
{
from: "15:30",
to: "19:00"
}
]
}
],
exceptions: [
{
date: "2026-12-24",
label: "Christmas Eve",
ranges: [
{
from: "07:00",
to: "17:00"
}
]
},
{
date: "2026-12-25",
label: "Christmas Day",
ranges: []
}
],
timezone: "London time (GMT)",
accepting: {
label: "Accepting click-and-collect orders",
help: "Off: your page still shows the hours but takes no order.",
on: true
},
save: "hours.save",
options: {
saveLabel: "Save hours"
}
}
</script>
<template>
<SettingsOpeningHoursWeekRows v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordsthe panel’s heading, e.g. "Opening hours" |
| intro | string | Wordsone sentence on where these hours show, e.g. "Shown on your shop page and used for bookings" |
| week* | Week[] | Datathe weekly hours as saved: one entry per day the merchant set; a day left out is closed |
| exceptions | Exception[] | Datathe dated exceptions as saved, closed days and special hours, in date order |
| timezone | string | Wordsthe time zone the hours are in, in words, e.g. "London time (GMT)" |
| accepting | Accepting | a switch for taking new bookings or requests; absent, no switch |
| save | string | Actionsaves the hours: through the host it receives `{ week, exceptions, accepting? }`; posted natively the form carries `<day>.open`, `<day>.from` / `<day>.to` (repeated, in order), `ex<n>.date`, `ex<n>.label`, `ex<n>.open`, `ex<n>.from` / `ex<n>.to` and `accepting`. Absent, or when the page lacks it, the hours are shown read-only |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Week week[] · 2 props
| Prop | Type | Description |
|---|---|---|
| day* | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun' | a day of the week: mon, tue, wed, thu, fri, sat or sun |
| ranges* | Range[] | the day’s opening ranges in order, a break being the gap between two; empty: closed that day |
Range week[].ranges[] · 2 props
| Prop | Type | Description |
|---|---|---|
| from* | string | Datawhen it opens, HH:mm on a 24-hour clock, e.g. "09:00" |
| to* | string | Datawhen it closes, HH:mm; earlier than `from` when it closes after midnight, e.g. "02:00" |
Exception exceptions[] · 3 props
| Prop | Type | Description |
|---|---|---|
| date* | string | the day, YYYY-MM-DD |
| label | string | Wordswhy, e.g. "Bank holiday" or "Late opening" |
| ranges* | Range[] | the hours that day instead of the week’s; empty: closed |
Range exceptions[].ranges[] · 2 props
| Prop | Type | Description |
|---|---|---|
| from* | string | Datawhen it opens, HH:mm on a 24-hour clock, e.g. "09:00" |
| to* | string | Datawhen it closes, HH:mm; earlier than `from` when it closes after midnight, e.g. "02:00" |
Accepting accepting · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the switch turns on, e.g. "Accepting new bookings" |
| help | string | Wordsone sentence on what it changes, e.g. "Off: your page shows the hours but takes no booking" |
| on* | boolean | true: the switch is on now |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| firstDay | 'mon' | 'sun' | the day the week starts on; Monday by default |
| saveLabel | string | Wordsthe save button, e.g. "Save hours" |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
hours.save - Reads
hoursfrom your app
A settings section, for app, settings pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More settings blocks
- Layout split rows: groups that save on their own: the title and its explanation beside the fields, one card per group.
- Layout tabs: three to five sections that read as one page of an account (Account, Security, Notifications).
- Notification preferences channel matrix: the same events sent on several channels (e-mail, SMS, push): one table, an event per row and a channel per column; on a phone, a card per event.
- Notification preferences switch groups: notification choices as switches grouped by channel, each with the reason it exists.
- Profile editor compact card: an account with few public fields: one narrow centred card, the portrait on top, a few fields and one full-width save button.
- Profile editor cover header: a profile with a cover picture: a wide card with the cover and the portrait over its edge, each with its own button, the fields in cards under it.
- Profile editor with preview: a creator, seller or member profile that others see: the form in cards, and beside it a card that repeats exactly what is typed.
- Sso split: A settings page with room to the side: the values to copy in a quiet panel on one side, the provider’s form on the other, so the admin copies and pastes across without scrolling.