@molecule/app-habit-streak-card-solid
Feature · habit-streak-card · App (browser) · v1.1.2 · Apache-2.0
Habit / streak card with current streak, best streak, completion heatmap
npm install @molecule/app-habit-streak-card-solidHow it works
@molecule/app-habit-streak-card-solid is a ready-made habit-streak-card feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
import type { StreakDay } from '@molecule/app-habit-streak-card-solid'
import { HabitStreakCard } from '@molecule/app-habit-streak-card-solid'
const recentDays: StreakDay[] = [
{ date: '2026-07-01', count: 1 },
{ date: '2026-07-02', count: 3 },
]
export function HabitView() {
return (
<HabitStreakCard
name="Morning Run"
icon={<span>🏃</span>}
currentStreak={14}
bestStreak={30}
totalCompletions={87}
heatmap={recentDays}
/>
)
}Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid
Reference
Solid habit / streak summary card — current streak, best streak, total completions, and an optional per-day heatmap strip. Use for habit trackers, meditation streaks, daily-task widgets.
Exports HabitStreakCard and the StreakDay / HabitStreakCardProps
types.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import type { StreakDay } from '@molecule/app-habit-streak-card-solid'
import { HabitStreakCard } from '@molecule/app-habit-streak-card-solid'
const recentDays: StreakDay[] = [
{ date: '2026-07-01', count: 1 },
{ date: '2026-07-02', count: 3 },
]
export function HabitView() {
return (
<HabitStreakCard
name="Morning Run"
icon={<span>🏃</span>}
currentStreak={14}
bestStreak={30}
totalCompletions={87}
heatmap={recentDays}
/>
)
}
Type
feature
Installation
npm install @molecule/app-habit-streak-card-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
API
Interfaces
StreakDay
Represents a single day's completion data for the heatmap strip.
interface StreakDay {
/** ISO date (yyyy-mm-dd). */
date: string
/** Completion count for the day (0 = not done, >0 = intensity). */
count: number
}
HabitStreakCardProps
Props accepted by the HabitStreakCard component (React's names).
interface HabitStreakCardProps {
/** Habit name. */
name: JSX.Element
/** Optional leading icon. */
icon?: JSX.Element
/** Current streak (days). */
currentStreak: number
/** Best streak (days). */
bestStreak?: number
/** Total completions. */
totalCompletions?: number
/** Optional heatmap days — rendered as a strip of squares. */
heatmap?: StreakDay[]
/** Days the heatmap should display (truncates `heatmap` from the end). Defaults to 30. */
heatmapDays?: number
/** Extra classes. */
className?: string
}
Functions
HabitStreakCard(props)
Habit / streak summary card with current + best streak, total completions, and an optional heatmap strip.
Solid counterpart of @molecule/app-habit-streak-card-react's
HabitStreakCard — the same props (React names), the same ClassMap tokens
and the same DOM for the same input. The stat labels and the heatmap's
strip and day labels go through useTranslation() with React's exact keys
and English defaults, and heatmapDays truncates heatmap from the end
(most recent days win).
function HabitStreakCard(props: HabitStreakCardProps): JSX.Element
props— Component props (seeHabitStreakCardProps).
Returns: The rendered habit streak card.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-solid^3.5.0 || ^4.0.0@molecule/app-ui^1.0.1@molecule/app-ui-solid^1.1.0solid-js^1.8.0
Runtime Dependencies
-
@molecule/app-solid -
@molecule/app-ui -
@molecule/app-ui-solid -
solid-js -
Requires the Solid binding's i18n provider (
useTranslation()THROWS without it) and a bonded ClassMap forgetClassMap(). Stat labels come from the@molecule/app-locales-habit-streak-cardcompanion bond. -
The heatmap strip uses a fixed green ramp with a light-only zero color (
rgba(0,0,0,0.08)) rendered as inline styles — on dark themes the empty cells are nearly invisible. For a theme-aware year grid use@molecule/app-heatmap-solidwith a customcolorScaleinstead. -
heatmapDaystruncatesheatmapfrom the END (most recent days win).
Translations
Translation strings are provided by @molecule/app-locales-habit-streak-card.