Skip to content
Twentyfirst UIHalo

Habit Tracker

Life · HabitTracker, Panel

View as Markdown

Habits with their last days as a row of marks: done, missed or no entry, today's mark a toggle.

  • days is one entry per day, oldest first and today last: true, false or null.
  • streak shows "12-day streak"; goal a short target ("8 glasses").
  • onToggle(id, done) makes today's mark a button; the other days are read-only and named for screen readers ("Mon Done").
  • Day labels default to weekday initials ending today; pass dayLabels to set them yourself.

Habits

This week

Morning walk3-day streak20 min
Drink water12-day streak8 glasses
Read3× a week
No screens after 10 pm

Props

HabitTracker

PropTypeNotes
habitsHabit[]Required
dayLabels?string[]Labels of the day columns, oldest first (default: weekday initials ending today).
onToggle?(id: string, done: boolean) => voidToday's box of a habit was toggled.
label?stringAccessible name of the list (default "Habits").
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Panel

PropTypeNotes
side?boolean
title?string
subtitle?string
action?ReactNode
children?ReactNode
surface?Surface`"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.