Black Friday: 30% off Pro

Get 30% off

Updated

Sleep Stages

New

Preview

Customize

Color
Width460px

Installation

npx shadcn@latest add https://uibrik.com/r/sleep-stages.json
Adds the files to components/uibrik/sleep-stages and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/sleep-stages.

Usage

import { SleepStages } from "@/components/uibrik/sleep-stages/sleep-stages";​<SleepStages  title="Sleep"  color="#6e56cf"  hour24={false}  width={460}  // nights={[{ label: "…", bedtime: "…", segments: […] }]}  // defaultNight={0}  // onNightChange={(index) => {}}  // segments={[{ stage: "awake", minutes: 0 }]}/>

Where to use Sleep Stages

  • Health and wearable apps

    The whole night reads in one chart, and scrubbing answers when each stage happened.

    Pairs with Daily Rings

  • Wellness dashboards

    Typical ranges next to each stage say whether a number is good without a separate legend.

    Pairs with Streak Calendar

  • Sleep tracker landing pages

    A hypnogram that draws in shows what the device measures before any copy does.

Props

SleepStages
title
Type string
"Sleep"
Heading above the chart.
color
Type string
"#6e56cf"
Hue the stages are shaded from. Awake stays neutral.
hour24
Type boolean
false
Show times in 24-hour format.
width
Type number
460
Width of the card; never wider than its container.
nights
Type { label: string; bedtime: string; score?: number; segments: SleepSegment[] }[]
–
Several nights, oldest first, with a strip to switch between them. Overrides segments, bedtime and score.
defaultNight / onNightChange
Type number / (index) => void
–
Night shown on mount (defaults to the last) and a callback when it changes.
segments
Type { stage: "awake" | "rem" | "light" | "deep"; minutes: number }[]
–
A single night in order, one entry per stretch in a stage; shown without the week strip.
className
Type string
–
Classes for the wrapper.