Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Data

Sparkline <pm-sparkline>

Sparkline: a small trend chart without axes, for stat cards and table cells.

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/sparkline'; </script> <pm-sparkline values="4,6,5,8,7,11,12" label="Revenue, last 7 days" tone="success"></pm-sparkline> <pm-sparkline type="area" values="9,8,8,6,7,5,4" label="Errors, last 7 days" tone="danger"></pm-sparkline> <pm-sparkline type="bar" values="3,5,4,7,6,8,5" label="Sign-ups, last 7 days"></pm-sparkline>

Overview

Takes the colour of its tone. With a label it is announced with its first and last value; without one it is decorative. Size with --pm-sparkline-width / --pm-sparkline-height.

Attributes

AttributeTypeDefaultDescription
valuesnumber[][]The numbers to plot, in order: values="3,5,4,8" or an array property.
type'line' | 'area' | 'bar'—line (default), area or bar.
labelstring—Accessible name, e.g. "Revenue, last 7 days".

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Used in templates

Overview dashboardTraffic analytics