Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Chart

    Recharts charts in Material 3 Expressive: a big readout that follows the point in focus, pill bars with a scalloped badge on goal days, dotted zone lines, stage lanes and progress rings. Dotted grid, quiet axes, an inverse tooltip and series colors from the accent roles. API-compatible with shadcn's Chart.

    Install

    npx shadcn@latest add @nelumbo/chart

    Goals and ranges

    One point is always in focus. Hover to preview, click or tap to select, or tab to the chart and use the arrow keys (Home, End, Page Up and Down; Escape goes back). The readout above the chart follows it, a line and a ring mark it, and the close button returns to today. Days that reach the goal, a full 96-well plate, take the full color and a check badge, and the goal is called out on the axis. A control charted against its accepted range marks the run that fell outside it.

    This week

    35samples, Today
    61 short of a plate
    24.7Ct, Today, positive control

    Zones and stages

    Zone boundaries are dotted lines in the zone's color, and the line changes color as it crosses them (ChartZoneGradient); the legend counts dots for intensity so it reads without color. ChartStages draws one lane per stage with hand-over connectors, ticks for moments, and the totals in the lane labels: here dissolved oxygen through a fermentation, and one cell's way through the cell cycle.

    14% DO, Run 0418, lowest
    Held at a 40% setpoint, with one dip when the glucose feed started at 9 hours
    23h 35mcycle
    From one division to the next, for cell 14 of a FUCCI HeLa time-lapse.

    Rings

    Progress toward daily goals on tonal tracks with round caps. Past the goal the ring keeps going: the second lap is drawn darker over the first.

    2/3goals met
    • Plates imaged42 of 40
    • Libraries through QC18 of 24
    • Sequenced312 of 300 Gb

    Colors

    Series without a color in the config take chartColors in order: blue, orange, green, purple, pink, cyan, amber, red. These are Nelumbo's accent roles, checked at 3:1 against the card in light and dark. Keep to five series or fewer, and use the legend and tooltip as the second channel for identity. Override with color or theme: { light, dark }.

    blueorangegreenpurplepinkcyanamberred

    Props

    PropTypeDefaultNotes
    configChartConfigPer series: label, icon, and color or theme { light, dark }. Becomes --color-<key> on the chart
    aria-labelstringNames the plot (role=img). State what the chart shows, with the headline numbers
    initialDimension{ width, height }480 x 270Size for the server render and before the first measure, so Recharts never sees 0
    ChartTooltipContent indicator"dot" | "line" | "dashed""dot"Marker beside each value
    hideLabel / hideIndicatorbooleanfalseDrop the heading or the markers
    labelFormatter / formatterfunctionSame as shadcn
    nameKey / labelKeystringWhich payload field names the item or the heading (pie and radial use nameKey)
    ChartLegendContent hiddenKeys, onTogglestring[], (key) => voidNelumbo: makes chips toggle buttons (aria-pressed). Pair with hide on each series
    useSeriesVisibility(){ hiddenKeys, toggle, isHidden }State helper for the interactive legend
    useChartAnimation()propsSpread on Bar, Area, Line, Pie, RadialBar: spring-like ease, off with reduced motion
    ChartContainer focusChartFocusFrom useChartFocus: the chart becomes one keyboard stop, a slider over its points, named by aria-label
    useChartFocus({ count, defaultIndex, describe })ChartFocusOne point in focus: chartProps for the chart, index, isDefault, reset(), fill(key, i). defaultIndex -1 starts on the summary
    ChartReadoutlabel, value, unit, detail, onClearThe big headline above a chart, announced politely. onClear adds the close button
    chartPillBar(key, { goal, badge })Bar shapePill bars; goal days in full color with a scalloped check badge, the rest a tint
    chartFocusLine, chartFocusDotpropsSpread on ReferenceLine x and ReferenceDot to mark the point in focus
    chartGoalLine(key), chartZoneLine(key)propsSpread on ReferenceLine y: a solid goal line, a dotted zone boundary
    chartTicks({ highlight, format })tickValue axis ticks; highlighted values (the goal) take a color
    ChartZoneGradientid, range, zonesA hard-stop gradient so a line changes color by zone
    ChartStagesconfig, data, levels, eventsStage lanes (cell cycle phases). Items without end in an events lane draw as ticks
    ChartRingsrings, size, thicknessConcentric progress rings; past the goal a darker second lap
    config swatch"dot" | "band" | "line" | number"dot"Legend marker; a number draws that many dots. ChartLegendContent keys lists config keys
    chartBarRadius, chartSegment, chartLine(key), chartDot(key), chartActiveDot(key), ChartGradientHelpers for the Nelumbo marks
    chartColorsstring[]var(--blue), var(--orange), var(--green), ... in series order