App UI kits › Sky › Sun and moon

Sun and moon

Drag the sun along its arc and the sky follows, with golden and blue hour marked on the way.

Sun and moon is a screen from Sky, an app ui kit with 8 screens: A weather app whose background is the real sky. Price: $5 for the whole pack.

Built with: draggable sun, golden/blue hour, drawn moon phase.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Sun and moon props

PropTypeDefaultDescription
sunrisenumber
sunsetnumber
moon{ lit: number; waxing: boolean; rise: string; set: string }Moon illumination 0–1 and whether it is waxing.
nownumber
autoplaybooleanShowcase mode: moves the sun by itself until touched.
onTime(hour: number) => void

Methods on the ref

Use it in React

import SkySun from './SkySun';

<SkySun />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Sky

Good for: Weather app UI, UI and UX design examples.