@openuidev/dashboard-library
v1.1.1
Published
OpenUI dashboard AI component library: the Dashboard/Section/CardRow layout grammar, filters, cards and charts a model composes into dashboards
Maintainers
Readme
@openuidev/dashboard-library
An OpenUI component library for dashboards: the components, prompt options and examples a model uses to compose dashboards.
Install
pnpm add @openuidev/dashboard-libraryUsage
Generate the system prompt with the CLI from a file that re-exports the library:
// src/lib/dashboard-library.ts
export { library, promptOptions } from "@openuidev/dashboard-library";npx @openuidev/cli generate src/lib/dashboard-library.ts --out src/generated/system-prompt.txtSend that file as the system message, then render the model's response:
import { ThemeProvider, library } from "@openuidev/dashboard-library";
import { Renderer } from "@openuidev/react-lang";
export function DashboardMessage({ response }: { response: string }) {
return (
<ThemeProvider mode="dark">
<Renderer response={response} library={library} />
</ThemeProvider>
);
}ThemeProvider is optional. It sets the mode (light by default) and takes lightTheme
and darkTheme overrides.
promptOptions holds the generation rules and examples. To build your own options, spread its
examples and additionalRules, which are also exported on their own.
Components
Dashboard is the root. 45 components in 10 groups:
| Group | Components |
| ------------- | ------------------------------------------------------------------------------------------------------------------ |
| Structure | Dashboard, Section, Row, Card |
| Filters | FilterBar, PeriodPicker, DateRangeFilter, ChipFilter, SelectFilter, MultiSelectFilter, CompareToggle |
| Metrics | Kpis, Kpi, Trend, Progress, Split, States, Stat, KeyValues, KeyValue, Goal |
| Tables | Table, Column |
| Trends | TimeSeries, Series, Reference, Marker, SmallMultiples, StatusTimeline |
| Comparison | Bars, Leaderboard, Dumbbell, Distribution, Intervals |
| Composition | Donut, SegmentedBar, Treemap, Waterfall |
| Flow | Funnel, Flow |
| Relationships | Scatter, Heatmap, Cohorts |
| Maps | GeoMap, PointMap |
