Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Local Time Portfolio Navbar Block for Svelte

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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A navbar for a portfolio in Svelte with Ark 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.

How does it sit on the page?

It's the page's first block: its + marks and rails line up with every block under it, and it draws no bottom border because the next block's top rule is its bottom edge. The sheet opens over the page and never changes the bar's height.