shadcn.io is not affiliated with official shadcn/ui
Local Time Portfolio Navbar Block for React
A one-bar navbar for a freelance designer's portfolio: numbered links, a green Available for work dot, her local time in Bogotá with online or offline read from it, and a Start a project Shine Button.
Installation
Overview
A navbar for a portfolio in React with Base UI. Ines Valdez, a freelance brand designer, is the wordmark; Work, About, Services and Contact follow as numbered links, the current page marked by a foreground stroke on the bar's bottom edge. At the end of the bar a green dot says "Available for work", and beside it a clock gives her local time in Bogotá with "online" or "offline" after it, read from that time: she answers messages from 08:00 until 19:00 there. A Start a project Shine Button closes the row. Below the lg breakpoint the status and the clock fold into a full-screen sheet from the top, with the links and the button. The clock is read after the page loads, so the server and the browser agree. It's built from Status, Sheet, Shine Button and Guides. For freelancers and studios whose site should say when you can answer.
FAQ
Where does the clock get the time?
From the visitor's own device clock, read once the page has loaded and again every 30 seconds, then moved to Bogotá by a fixed offset (OFFSET_MINUTES, minus 300). Until it has been read, the digits are dashes and "online" and "offline" are unseen, in the same width, so nothing shifts. Bogotá has no daylight saving, which is why a fixed offset stays correct all year. For a city that changes its clocks, replace localMinutes with Intl.DateTimeFormat and a time zone.
How do online and offline work?
isOnline compares the local minutes with OPEN_FROM (08:00) and OPEN_TO (19:00). Both words sit in one grid cell and the one that doesn't apply is invisible and hidden from screen readers, so the clock reads as "Bogotá 09:32 online" and the width never moves. It ignores weekends; add a day check to isOnline if you want one.
Does anything move?
Only the digits, once every 30 seconds: there is no animation, so reduced motion changes nothing. The dot is still.
How does it work on a phone?
Below lg the numbered links, the status and the clock leave the bar. A menu button opens a full-screen sheet from the top: its header lines up with the bar (the name where it was, a close button where the menu button was), then the four links in large type with their numerals, the status and the clock, and the button in its foot. From sm the Start a project button stays in the bar. Choosing a link closes the sheet.
Related
- Pro
SaaS Marketing Navbar
Mega menusA one-bar marketing navbar for a product roadmap tool: a wordmark, a Product menu of four areas with icons and one-line descriptions, plain links with the current page marked, Sign in and a Shine Button, and a sheet with the same links on phones.
- Pro
Minimal Navbar
Link highlightsThe least navbar there is: a slim 48 px bar with a wordmark, three plain links and one Shine Button for a journaling app, with no motion, the current page marked by weight and a dot, and a bottom drawer on phones.
- Pro
Landing Page Navbar
Link highlightsA 64 px navbar built for a landing page: a skip link that appears on keyboard focus, in-page links that jump to the page's sections, the chosen section marked by a stroke on the bar's edge, a Log in link and a Shine Button, with a sheet on phones.
- Pro
Stars Button Open Source Navbar
Meters and progressA one-bar navbar for an open source embedded database: a version badge by the wordmark, Docs, Examples and Playground links, a Releases menu of the last three versions, a GitHub stars button with a typed count and a Get started Shine Button.
- Pro
Next Appointment Navbar
Players and clocksA booking navbar for salon software: links to the schedule, a next-appointment chip with a live countdown, and a New booking action.
- Pro
Fullscreen Overlay Navbar
Mobile and drawersA full-screen menu navbar for an architecture studio: a two-line menu button at every width opens a sheet that fills the screen with five large numbered links on hairline rows that fade up one after the other.