Skip to content

Dashboard Grid ​

An auto-fill grid of dashboard tiles: as many columns as fit, tiles spanning columns or the full row. KPI tiles from props, anything else in the slot.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SDashboardGrid ​

Dashboard section: optional heading + an auto-fill grid of tiles (repeat(auto-fill, minmax(minTileWidth, 1fr))) — 1 column on a phone, 2–4+ on tablets and desktops, no breakpoints. Tiles span columns with span (clamped to the current column count) or the whole row with full.

Heading-row actions go in actionsBuilder: wrapBuilder(rangePicker) (a global @Builder), so the tiles keep the trailing closure.

PropTypeDefaultDescription
titleResourceStr | undefinedundefined
descriptionResourceStr | undefinedundefined
minTileWidthnumber240minimum tile width (vp)
gapnumber16
maxColumnsnumber0upper bound on columns (0 = unlimited)
actionsBuilderWrappedBuilder<[]> | undefinedundefinedTrailing content of the heading row (filters, a date range, actions); needs a title. A region, not a slot: actionsBuilder: wrapBuilder(myActions) of a global @Builder (no this: render a component).

Slots: children (trailing closure)

SDashboardTile ​

A dashboard card. Quick props render a KPI tile (title + icon, big value, delta with trend icon); the slot adds anything else (charts, tables, lists) below.

PropTypeDefaultDescription
titleResourceStr | undefinedundefined
iconstring | undefinedundefined
valueResourceStr | undefinedundefined
deltaResourceStr | undefinedundefined
trendDashboardTrend
DashboardTrend = 'up' | 'down' | 'none'
'none'
spannumber1columns spanned (clamped to the current column count)
variantCardVariant
CardVariant = 'default' | 'outline' | 'elevated' | 'ghost' | 'filled'
'default'card variant of the tile (the theme's --card-* tokens apply as to any SCard)
tokensCardTokens{}per-instance card tokens (ADR D13), e.g. { background: 'transparent', shadow: 'none' }
fullbooleanfalsespan the whole row

Slots: children (trailing closure)

MIT Licensed