Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Widget

The tile a dashboard is made of

A widget is a titled tile: a heading, an optional count, and whatever the tile is about. Rows and groups fill it with a list, the grid packs a set of them into a board, and the translucent surface lets a page’s background through without losing the text.

A board

The grid packs tiles of different heights into columns with no holes beside the tall ones, and folds to one column as it narrows. Every figure here is made up.

Working now1

Reconciling September’s books212 of 340 transactions matched2m 13s

Revenue

$189kLast 14 days+12% on the fortnight before

Approvals4

Travel expenses, Q3 offsiteDana WhitfieldDue today
Renewal terms for Harbor & VineLeo CastellanosNew
Laptops for the new hiresPurchase orderApproved
Payment to Atlas FreightBank transferFailed

This month

Revenue$412,300
Gross margin61%
New customers18

Rows

A row is a leading mark, a title over a description, and a trailing fact. It is a link with an href, a button with a click handler, and a plain line otherwise, so a list only offers a target where there is somewhere to go.

Recent accounts

Invoices3

Northwind TradingDue Oct 14$12,400
Juniper Health12 days late$8,950
Oakline RetailDue Oct 28$21,700

Alternatives

  • Use Grid instead when cells of any kind should sit in equal columns and share a row’s height.
  • Use Form section instead when the section holds a form’s fields and its own save.
  • Use Decision row instead when each row waits on a yes or a no and settles to the answer.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

Widget

Widget props
PropTypeDefaultDescription
title*
string
The tile's heading. Also the section's accessible name, unless an `aria-label` is passed. Note: this shadows the native `title` tooltip attribute, which Widget does not expose.
count
number
A quiet figure after the title: how many rows the tile holds, how many are open.
action
ReactNode
Trailing header slot, opposite the title — a compact button, a link, a period label.
titleAs
"h2" | "h3" | "h4"
'h3'
Heading element for the title, so the tile takes its place in the page's outline.
description
ReactNode
A line of quieter text under the title, saying what the section holds. It also describes the section to a screen reader.
footer
ReactNode
A slot under the body, behind a divider: the section's actions (Save, Cancel), a total, a link to everything.
padding
"none" | "default" | "compact"
'default'
The inset: `default` the tile's own, `compact` a step tighter for dense settings, `none` for a body that runs edge to edge (a table, a map) while the header and footer keep the default inset.
collapsible
boolean
false
Let the reader fold the section away: the title becomes a button that shows and hides the body and footer, which leave the tab order and the accessibility tree while hidden.
open
boolean
Whether a collapsible section is open (controlled). Pair with `onOpenChange`.
defaultOpen
boolean
true
Whether a collapsible section starts open (uncontrolled). Defaults to true.
onOpenChange
((open: boolean) => void)
Called with the new open state when the reader folds or unfolds a collapsible section.
children
ReactNode
The tile's body: WidgetRows, WidgetGroups, a chart, a figure, a form, anything.
locale
string
'en-US'
The BCP 47 locale the count is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider.
className
string
''
Additional CSS classes

WidgetGrid

WidgetGrid props
PropTypeDefaultDescription
columns
1 | 2 | 3
2
The most columns the board runs to. It folds to fewer as its own width narrows.
children
ReactNode
The Widgets on the board, in reading order: they fill the first column, then the next.
className
string
''
Additional CSS classes

WidgetGroup

WidgetGroup props
PropTypeDefaultDescription
label*
string
The run's quiet label, e.g. "Waiting on you".
children
ReactNode
The rows in this run.
className
string
''
Additional CSS classes

WidgetRow

WidgetRow props
PropTypeDefaultDescription
title*
string
The row's main line. Note: this shadows the native `title` tooltip attribute, which WidgetRow does not expose.
description
string
A quiet second line under the title: who, where, or how much.
leading
ReactNode
Leading mark — a StatusDot, a PixelAvatar, an Avatar, a Spinner, an icon. Decorative unless the element names itself.
meta
ReactNode
Trailing fact in the caption face: a date, an amount, a state.
actions
ReactNode
Controls at the row's end, after the meta: an Approve and a Decline button on a request, say. A row with actions is not itself a link or a button, since a control cannot hold others, so it takes no `href` or `onClick`.
href
string
Renders the row as a link to this URL.
chevron
boolean
A trailing chevron saying the row goes somewhere, mirrored in a right-to-left context. Defaults to on for a row with `href` and off otherwise; a row whose `onClick` opens a page of its own can turn it on.
className
string
''
Additional CSS classes
linkComponent
LinkComponent
The component its links render with, such as Next.js's `Link`, so they navigate through the app's router; a plain `<a>` when unset. This component can render on the server, so it never reads a LinkProvider: pass the prop even under one.

Keys

Nothing here takes focus, so there are no keys. A test holds that.

tsx
// From the npm package
import { Widget } from 'rift-ds/components/Widget/Widget';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/widget.json

1.8 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.