Genesis
@beta

Widget

One widget, drawn on the one widget tile (`WidgetTile`). Reads through the data provider in the viewer's scope (ViewerScope), under row security, and keeps itself current (`live`, default on). Hidden when the viewer can't read a field it totals or the widget's `can` says no. ```tsx <DashboardPage title="Sales" stats={<><Widget widget={openDeals} /><Widget widget={pipeline} /></>} /> ```

packages/ui/src/components/data/widget/Widget.tsx

Import
Subpath export: @marktiderman/genesis-ui/data
import { Widget } from "@marktiderman/genesis-ui/data";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

Widget

One widget, drawn on the one widget tile (`WidgetTile`). Reads through the data provider in the viewer's scope (ViewerScope), under row security, and keeps itself current (`live`, default on). Hidden when the viewer can't read a field it totals or the widget's `can` says no. ```tsx <DashboardPage title="Sales" stats={<><Widget widget={openDeals} /><Widget widget={pipeline} /></>} /> ```

PropTypeDefaultDescription
widget*DefinedWidget | WidgetDefinition—From `defineWidget`.
classNamestring—
iconReactNode—An icon beside the label.
linkComponentLinkComponent({ href, children, testID, ...rest }) => ( <a href={href} data-testid={testID} {...rest}> {children} </a> )Router link for `href` and `rowHref`. Default a plain `<a>`.
localestring—Number locale (`Intl`). Default the runtime's.
refused((reason: string) => ReactNode)—Shown in place of the tile when the viewer may not see it. Default nothing.
rowHref((row: Record<string, unknown>) => string)—A list widget's link for one row (its record page).
Storybook
Storybook hosts the canonical visual reference with controls for every variant.