Widget
Dashboard container: title, actions, big number, legend and chart area. Pro · Data and metrics › Metrics and widgets
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add widget
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { Widget } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
title | ReactNode | Heading of the widget. | |
description | ReactNode | Muted line under the heading. | |
actions | ReactNode | Controls at the end of the header: a period select, a menu button. | |
value | ReactNode | Headline figure under the header: "$5,420", "72/52". | |
unit | ReactNode | Unit after the figure: "kcal", "avg". | |
legend | WidgetLegendItem[] | [] | Series dots with names. |
legendPosition | 'header' | 'footer' | Where the legend goes: beside the title or centered under the content. Default header for inset, footer for card. | |
variant | 'inset' | 'card' | 'inset' | inset: a tinted shell around an elevated content area; card: one surface. Default inset. |
footer | ReactNode | Content under the body: a link, a note, buttons. | |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | 3 | Level of the heading (default 3). |
Related components
- Stats Card — Metric cards
- KPI Group — KPI row: value, change vs. previous period, sparkline and progress to goal
- Number Value — Locale-aware number: currency, percent, compact notation and units
- Trend Value — Metric change: arrow, sign and color, as text or a pill
- Proportion Bar — Proportion bar with a legend: storage, budget, breakdown
- Activity Rings — Concentric progress rings toward goals
- Leaderboard — Leaderboard: medal places, thumbnails, numbers and change over a period
- Data Table — Tables with search and sorting
- Data Grid — Grid for 100,000 rows: grouping, filters, inline editing
- Virtual List — Virtual list for 100,000 rows
- Bulk Action Bar — Actions for selected rows, with keyboard shortcuts
- List Block — List with images or icons, descriptions and values
Previous: KPI Group · Next: Number Value · All Data and metrics