shadcn.io is not affiliated with official shadcn/ui
Timezone and Calendar Settings Block for React
A working hours settings panel: seven bars, one per day, with start and end selects and an Open switch, a week start that turns the rows, a Copy Monday to weekdays button, and a time zone pair that turns the first open day into both zones.
Installation
Overview
Show people when they can book you, and what that looks like from where their guests are, with this working hours panel for React with Base UI. A hairline frame with a plus mark on each corner opens with a band for the time zone: two Native Selects, your zone and the one to show guests, and a sentence that turns your first open day into both ("09:00 on Monday in Lisbon is 10:00 in Berlin"). The next band holds a Segment Group for the day the week starts on, a Copy Monday to weekdays button and a running total ("5 days open, 41 h a week"). Then come the seven bars: each day is a 24-hour track with the working span filled, a Switch that opens or closes the day, and start and end selects in half hours. An edit that would end the day before it starts moves the other end, so a day is never empty by accident. The last band counts unsaved changes beside a Shine Button to save them and an outline Button to discard them, and it stays pinned to the bottom of the screen while the panel scrolls. It's built from Native Select, Segment Group, Switch, Button, Shine Button and Guides, with a CSS entrance only. For a scheduling or booking product, a support desk or an availability page.
FAQ
How do I use my own hours, zones and week?
Edit the constants at the top. SAVED holds the seven days (Monday first) as an open flag and the minutes after midnight at which the day opens and closes, plus your zone, the guests' zone and the day the week starts on. ZONES lists the time zones the two selects offer by their IANA names. The track widths, the totals and the converted times are all worked out from those, so nothing is typed twice.
How is the time in another zone worked out, and what about daylight saving?
By the browser's Intl.DateTimeFormat, from the zone names, not from fixed offsets. The sentence converts the first open day's hours on one fixed week (the week of 12 October 2026), so it follows each zone's real rules for that week: Lisbon and Berlin differ by an hour then, and the offsets in the select labels are those of the same week. A week in which one zone has changed its clocks and the other has not would read differently, and this block does not show that.
How do the bars and selects behave?
Each track is drawn from the day's start and end, so it moves as soon as a select changes, and the closed switch empties it and disables the selects without moving anything. The selects count in half hours, and the end can reach 24:00. If you move a start to or past the end, or an end to or before the start, the other end moves an hour so the span stays valid, and the status line says where the day now runs. Copy Monday to weekdays copies Monday's hours, or its closed state, to Tuesday through Friday and leaves the weekend alone.
What does the week start change?
Only the order of the rows: choosing Sunday or Saturday turns the seven bars so that day is on top, in the same fixed slots, so the panel keeps its height. The hours stay with their days, and Monday remains the day that Copy Monday to weekdays copies from.
What happens when I press Save, and what stays local?
Nothing leaves the page. The block keeps the saved hours and the ones being edited, counts the days and settings that differ and says so in its status line. Save makes the edited copy the saved one and says so in this demo; Discard puts the saved copy back. To make it real, send the hours and zones to your API in the save handler and update the saved copy from the response. Save and Discard are marked aria-disabled rather than disabled while nothing changed, so they keep their place and focus.
How does it look on a phone, and is it accessible?
Below the medium breakpoint each day is a card: its name and total with the open switch, the bar across the full width, then the two selects side by side labelled Opens and Closes. Every select and switch is named for its day ("Tuesday opens", "Tuesday open"), the tracks are decorative because the selects say the same, and the status line is a polite live region that announces each change.
Related
- Pro
Language and Region Settings
Appearance and localeA language and region settings panel: two selects over three cells that show what they do, a sort order made by the language's collation, a month marked with the region's first weekday, and units with a worked example.
- Pro
A support chat widget settings panel built around a week of opening hours, with a Preview at slider across the week that flips a drawn chat bubble between the greeting and the offline message.
- Pro
Mentor Availability Profile
Schedules and bookingA mentor profile that books across time zones: slots set once in UTC, a zone menu, a month grid marking the days with times, times that roll into the next day where they must, and session types with prices.
- Pro
Notification Preferences Settings
NotificationsA notification settings panel: a channel strip with all-or-nothing checkboxes, a matrix of switches by activity and channel with a locked security email, quiet hours, and a save bar that counts unsaved changes.
- Pro
Appearance Settings
Appearance and localeAn appearance settings panel that previews instead of applying: a drawn app window that wears the choices, theme and contrast cards with a drawn thumbnail each, a text-size slider with a sample sentence and a reduce motion switch with a replay.
- Pro
Brand Asset Settings
Appearance and localeA logo check panel: Paper and Ink tiles showing a drawn lettermark at true size with its clear space in hairlines and its contrast worked out from the hex values, a Full, Mark or Mono toggle, a size slider that warns below 24 px, and a four-colour palette with Copy.