Skip to content

shadcn.io is an independent project built on shadcn/ui

Globe Day Night Map Block for Ark UI

A live globe with the night side shaded for any date and hour: twilight steps, the terminator, the sun's overhead point, and ten cities' local times.

On this page5 sections

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

See where it's day and where it's night, with this globe day night map for React with Ark UI. Dawnwick, a daylight atlas, puts ten cities from Honolulu to Auckland on a live Map drawn as a globe that follows your theme, light or dark. A Toggle Group picks the date (the 2026 equinoxes and solstices) and a Slider the time of day in UTC, in quarter hours; a Play Toggle runs the whole day in 96 steps and stops. From the date and the time the block computes where the sun is overhead and shades the globe in four steps (day, civil, nautical and astronomical twilight, night), with a solid line on the terminator and a sun badge at the overhead point. Each city's pill reads its local time with a sun or a moon, and the grid of cells under the band gives the same in words: Day, Dawn, Dusk or Night. Choosing a city turns the globe to face it and fills the line under the grid with its sunrise, sunset and hours of daylight on that date, from over 21 hours of daylight in Reykjavík in June to about 4 in December. Built from Map, Toggle Group, Slider, Toggle and Guides. For travel and photography apps, weather and astronomy sites, classrooms and world clocks.

FAQ

How is the sun's place worked out?

sunAt uses the low-precision solar position: the sun's mean longitude and anomaly give its place on the ecliptic, which gives its declination and right ascension, and the sidereal time turns that into the longitude where it is overhead. It is good to about a hundredth of a degree near 2026, a minute or so of time. Nothing is fetched to work it out.

How is the night side drawn?

Each step is a cap of the globe: everything more than 90, 96, 102 or 108 degrees from the sun's overhead point, the sun's centre 0, 6, 12 and 18 degrees below the horizon. capOf turns a cap into polygon rings, a small circle, a circle closed over the pole it holds, or the world less the opposite cap. On a light theme the night caps darken in steps; on a dark theme the day caps lighten instead, so the dark side always reads as the darker.

Are the local times right, with daylight saving?

Yes. Each city keeps its real IANA time zone, and the times come from the browser's own time zone data for that date and hour, so London reads summer time in June and Auckland in December. Sunrise and sunset are worked out for the city's place and the date, with the sun's disc and the air's bending taken into account, and shown on the city's clock.

Can I use it without a mouse?

Yes. The dates are a toggle group, the time is a slider that moves in quarter hours with the arrow keys, Play is a toggle that pauses as well, and every city in the grid is a button that turns the globe to it. The pills on the globe are a pointer shortcut to the same choice. A polite message gives the count of cities in daylight and the chosen city's time once the change settles, never while the day plays.

What does Play do with motion turned down?

Play is never started for you: it runs only when pressed, one quarter hour every quarter of a second for a day, and stops on its own or when pressed again or when the slider moves. The globe itself stays still; only the shading and the clocks step.

How does it look on a phone?

The globe comes first, sized to the box, then the date and Play row, the time slider, the cities in two columns, and the chosen city's sunrise, sunset and daylight. Scrolling over the globe scrolls the page; hold Ctrl or ⌘ to zoom it, or use two fingers.