Introduction
Install PeakUI Pro, import its styles in the right order and render your first component.
PeakUI Pro ships as two packages: @peakui-pro/react for components and @peakui-pro/styles
for their CSS. Both build on the core PeakUI packages.
Usage
Install the two Pro packages — the core (@peakui/react, @peakui/styles) arrives with them
as a dependency, so a single install is enough:
npm install @peakui-pro/react @peakui-pro/stylesThe styles are imported in a fixed order — Tailwind, then the core, then Pro. The order and the reason for it are in Theming.
Optional Peers and Subpath Imports
A component that draws a chart is imported from its own subpath and needs recharts.
| Component | Import | Peer |
|---|---|---|
AreaChart | @peakui-pro/react/area-chart | recharts >=3.0.0 |
KPI | @peakui-pro/react/kpi | recharts >=3.0.0 |
BarChart | @peakui-pro/react/bar-chart | recharts >=3.0.0 |
ComposedChart | @peakui-pro/react/composed-chart | recharts >=3.0.0 |
LineChart | @peakui-pro/react/line-chart | recharts >=3.0.0 |
PieChart | @peakui-pro/react/pie-chart | recharts >=3.0.0 |
RadarChart | @peakui-pro/react/radar-chart | recharts >=3.0.0 |
RadialChart | @peakui-pro/react/radial-chart | recharts >=3.0.0 |
npm install rechartsEvery other component comes from the package root, which reaches no peer: an app that renders no
chart never installs recharts, and never fails on a server for want of it.
import {ChartTooltip, KPIGroup, NumberValue, TrendChip, Widget} from "@peakui-pro/react";
import {AreaChart} from "@peakui-pro/react/area-chart";
import {KPI} from "@peakui-pro/react/kpi";The chart palette, --chart-1 to --chart-5, is derived from your theme's accent. The
derivation, the override recipe and the browsers that need the five declared by hand are on
Colors.