Elements

Components / Application

Widgets

The dashboard kit. Stat is the headline KPI tile; Widget is the panel shell, with a reusable WidgetListItem row and a WidgetGrid layout. The same row powers deadlines, approvals, arrears, and portfolio health — change the data, not the markup. See it all composed on the manager dashboard preview.

Installation

bash
npx shadcn add https://raw.githubusercontent.com/levi-putna/elements/main/registry/widget/registry.json
npx shadcn add https://raw.githubusercontent.com/levi-putna/elements/main/registry/stat/registry.json

Stat — KPI strip

A headline number with a label, tinted icon chip, trend delta, and caption. Tone colours the icon chip only — the surface stays white, per the brand. Set sentiment when a falling number is good (arrears down is positive).

StatGroup · four portfolio KPIs

Needs attention

12

3 today

Levy arrears

$84.2k

4%across 37 lots

Statutory deadlines

5

1 overdue · 30 days

Open maintenance

16

2 emergency

tsx
import { Stat, StatGroup } from "@/components/ui/stat"
import { Receipt } from "lucide-react"

<StatGroup columns={4}>
  <Stat
    label="Levy arrears"
    value="$84.2k"
    icon={Receipt}
    tone="warning"
    delta={{ value: "4%", direction: "down", sentiment: "positive" }}
    caption="across 37 lots"
    href="/levies"
  />
</StatGroup>

Widget — panel + list

A bordered panel with a header (title, count, trailing action), a flush list body, and an optional footer. WidgetListItem renders leading icon · title + meta · trailing.

tsx
import {
  Widget, WidgetHeader, WidgetTitle, WidgetAction,
  WidgetContent, WidgetList, WidgetListItem,
} from "@/components/ui/widget"
import { CalendarClock, ShieldCheck } from "lucide-react"

<Widget>
  <WidgetHeader>
    <WidgetTitle icon={CalendarClock}>Upcoming deadlines</WidgetTitle>
    <WidgetAction href="/calendar">Calendar</WidgetAction>
  </WidgetHeader>
  <WidgetContent flush>
    <WidgetList>
      <WidgetListItem
        icon={ShieldCheck}
        iconTone="warning"
        title="Fire safety statement (AFSS)"
        meta="Harbour View Towers · SP 1042"
        href="/compliance"
        trailing={<span className="text-xs text-ink-muted">Due in 9 days</span>}
      />
    </WidgetList>
  </WidgetContent>
</Widget>

WidgetGrid — dashboard layout

A responsive grid. With columns={3}, wrap the main panels in a lg:col-span-2 column and the side panels in the third.

tsx
import { WidgetGrid, Widget } from "@/components/ui/widget"

<WidgetGrid columns={3}>
  <div className="space-y-4 lg:col-span-2">
    <Widget>{/* main panel */}</Widget>
  </div>
  <div className="space-y-4">
    <Widget>{/* side panel */}</Widget>
  </div>
</WidgetGrid>

Stat props

PropTypeDefaultDescription
labelstring-Short metric name, e.g. "Levy arrears".
valueReactNode-The headline value. String, or a node for split/currency values.
iconLucideIcon-Optional leading icon shown in a tinted chip.
tone"default" | "accent" | "warning" | "danger" | "info""default"Colour signal for the icon chip. The card surface stays white.
delta{ value: string; direction: "up" | "down" | "flat"; sentiment?: "positive" | "negative" | "neutral" }-Trend pill under the value. Sentiment defaults to up=positive / down=negative — override when a falling number is good.
captionstring-Supporting text after the delta, e.g. "vs last month".
hrefstring-When set, the whole tile becomes a link.

StatGroup props

PropTypeDefaultDescription
columns2 | 3 | 44Columns at the largest breakpoint. Collapses to one column on mobile.

Widget props

PropTypeDefaultDescription
tone"default" | "muted""default"Surface colour. default = white, muted = off-white for alternation.

WidgetTitle props

PropTypeDefaultDescription
iconLucideIcon-Optional leading icon.
countnumber-Optional count chip after the title (e.g. open item count).
as"h2" | "h3""h3"Heading level.

WidgetContent props

PropTypeDefaultDescription
flushbooleanfalseRemove padding so an edge-to-edge list sits flush with the border.

WidgetListItem props

PropTypeDefaultDescription
iconLucideIcon-Leading icon shown in a tinted chip.
iconTone"default" | "accent" | "warning" | "danger" | "info""default"Colour of the leading icon chip.
titleReactNode-Primary line (truncates).
metaReactNode-Secondary metadata line — scheme, plan, dates (truncates).
trailingReactNode-Trailing content: a badge, value, status indicator, or stack. Right-aligned.
hrefstring-Makes the whole row a link with a hover state and chevron.
showChevronboolean-Force the trailing chevron. Implied when href is set.