Skip to content

Components

Conditions card

The headline card: a title and advice from the condition result, the Explore button, the cloud bar and four rise and set cells.

Preview

Clear Skies
Perfect visibility for observation
Cloud Cover12%
SUNRISE06:12
SUNSET18:47
MOONRISE21:30
MOONSET08:02

Variants

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

Night
12%
Clear Skies
Perfect visibility for observation
Cloud Cover12%
SUNRISE06:12
SUNSET18:47
MOONRISE21:30
MOONSET08:02
Variant.tsx
<AppConditionsCard  title="Clear Skies"  subtitle="Perfect visibility for observation"  cloud={12}/>

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
<AppConditionsCard cloud={12} title="Clear Skies" subtitle="Perfect visibility for observation" />
app-widgets.tsx · AppTimeCell
/** One of the four rise and set cells of the conditions card. */export function AppTimeCell({ label, time }: { label: string; time?: string }) {  return (    <div className="app-cell">      <span className="app-label-sm">{label}</span>      <span className="app-label-md">{time ?? "--:--"}</span>    </div>  );}
app-widgets.tsx · AppConditionsCard
/** ConditionsCard: headline, the Explore button, the cloud bar and the four time cells. */export function AppConditionsCard({  title = "Clear Skies",  subtitle = "Perfect visibility for observation",  cloud = 12,  times = { sunrise: "06:12", sunset: "18:47", moonrise: "21:30", moonset: "08:02" },}: {  title?: string;  subtitle?: string;  cloud?: number;  times?: { sunrise?: string; sunset?: string; moonrise?: string; moonset?: string };}) {  return (    <div className="app-ui app-card is-conditions">      <div className="app-card-head">        <div>          <div className="app-heading">{title}</div>          <div className="app-label-sm">{subtitle}</div>        </div>        <AppButton size="sm">Explore</AppButton>      </div>      <AppCloudBar value={cloud} />      <div className="app-cells">        <AppTimeCell label="SUNRISE" time={times.sunrise} />        <AppTimeCell label="SUNSET" time={times.sunset} />        <AppTimeCell label="MOONRISE" time={times.moonrise} />        <AppTimeCell label="MOONSET" time={times.moonset} />      </div>    </div>  );}
app-ui.css
.app-card {  position: relative;  box-sizing: border-box;  display: flex;  flex-direction: column;  padding: var(--spacing-f13);  border-radius: var(--radius-f21);  border: var(--spacing-f1) solid var(--hair-strong);  background: var(--sheen), var(--fill);  box-shadow: var(--highlight);  backdrop-filter: blur(var(--spacing-f13));  overflow: hidden;}.app-card.is-conditions { width: min(100%, var(--container-f377)); gap: var(--spacing-f13); }.app-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--spacing-f8); }.app-cells { display: flex; gap: var(--spacing-f8); }.app-cell {  flex: 1;  display: grid;  align-content: center;  justify-items: center;  height: var(--spacing-f55);  border-radius: var(--radius-f13);  border: var(--spacing-f1) solid var(--hair);  background: var(--sheen), var(--fill);  box-shadow: var(--highlight);  box-sizing: border-box;}

API reference

React propFlutter parameterTypeDefaultMeaning
title, subtitleconditionQuality.shortSummary, detailedAdvicestringClear SkiesHeadline and advice.
cloudweather.cloudCovernumber12Cloud bar value.
timesriseSetProviderobjectsampleSunrise, sunset, moonrise, moonset.

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
Widthmin(100%, --container-f377)AstrLayout (377)345
Padding, gap--spacing-f13AstrSpace.f1316, absolute offsets 69 and 162
Title, advice--text-s0, --text-s-2AstrType.s0, sNeg2heading 16, labelSm 10
Explorebutton, compactAstrGlassButton(compact: true)accent pill 100 by 27
Time cells--spacing-f55 high, --radius-f13AstrSize.control, AstrRadius.f1364 high, 12