Skip to content

Components

Sky state background

Each of the six sky states has an illustrated sky drawn at half opacity under a blue wash.

Preview

Milky Way visible
Starry skies
Planets visible
Few stars
Cloudy
Too much light

Variants

Pick a variant with the controls. The preview and both code blocks follow.

State
Starry skies
Variant.tsx
<AppSkyState state="starrySkies" />

Implementation

The React tab is this site's own component, the same source that draws the preview, styled by the CSS below it. The Flutter tab is the Dart a screen builds it with, from the app's tokens.

Usage
<AppSkyState state="starrySkies" note="Clear and dark" />
app-widgets.tsx · AppSkyState
/** SkyStateBackground: the illustrated sky at half opacity under the blue wash, with its state name. */export function AppSkyState({ state, note }: { state: SkyStateKey; note?: string }) {  const { image, label } = SKY_STATE_ASSETS[state];  return (    <div className="app-ui app-state">      {/* eslint-disable-next-line @next/next/no-img-element */}      <img src={`/app/${image}.jpg`} alt="" />      <div>        <div className="app-heading">{label}</div>        {note && <div className="app-label-sm">{note}</div>}      </div>    </div>  );}
app-ui.css
.app-state {  position: relative;  overflow: hidden;  flex: 1 1 var(--spacing-f144);  min-height: var(--spacing-f144);  border-radius: var(--radius-f21);  background: var(--c-ink);  border: var(--spacing-f1) solid var(--hair-strong);  box-shadow: var(--highlight);}.app-state img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: var(--mag-1); }.app-state::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--c-accent) var(--mag-4), transparent), transparent); pointer-events: none; }.app-state > div { position: absolute; left: var(--spacing-f13); right: var(--spacing-f13); bottom: var(--spacing-f13); z-index: 1; }

API reference

React propFlutter parameterTypeDefaultMeaning
stateskyStateSkyStateKey / SkyStaterequiredOne of six.
notenonestringnoneOptional caption on the web tile.

Design tokens

Every value on this component is a system token. The last column is what the app widget uses today, so the gap to close is visible.

RoleCSS tokenDart tokenApp widget today
Min height--spacing-f144AstrSpace.f144full screen background
Radius--radius-f21AstrRadius.f21none
Image opacity--mag-1Mag.m10.5
Washdeep-space-200 at --mag-4, top to clearMag.m4Color(0x33448AFF)
Label--text-s0AstrType.s0none