Minimal inline chart components for sparkline visualizations.
Inspired by Tremor's spark-elements. These are compact charts designed for inline use — no axes, no legend, no tooltip. Pure SVG rendering.
Components
spark_line_chart— mini line chartspark_area_chart— mini area chart with gradient fillspark_bar_chart— mini vertical bar chart
Examples
<.spark_line_chart data={[4, 7, 5, 10, 3, 8]} />
<.spark_area_chart data={[4, 7, 5, 10, 3, 8]} color="oklch(0.60 0.20 240)" />
<.spark_bar_chart data={[4, 7, 5, 10, 3, 8]} />
Summary
Functions
Minimal area chart for inline sparkline use with gradient fill.
Minimal bar chart for inline sparkline use.
Minimal line chart for inline sparkline use.
Functions
Minimal area chart for inline sparkline use with gradient fill.
Attributes
data(:list) (required) - List of numeric values.color(:string) - Fill/stroke color. Defaults to"oklch(0.60 0.20 240)".curve(:atom) - Interpolation. Defaults to:linear. Must be one of:linear,:smooth, or:monotone.show_gradient(:boolean) - Apply gradient fill. Defaults totrue.stroke_width(:any) - Stroke width. Defaults to2.show_animation(:boolean) - Enable fade animation. Defaults tofalse.animate_duration(:integer) - Animation duration in ms. Defaults to900.class(:string) - Defaults tonil.- Global attributes are accepted.
Minimal bar chart for inline sparkline use.
Attributes
data(:list) (required) - List of numeric values.color(:string) - Bar fill color. Defaults to"oklch(0.60 0.20 240)".show_animation(:boolean) - Enable grow animation. Defaults tofalse.animate_duration(:integer) - Animation duration in ms. Defaults to900.class(:string) - Defaults tonil.- Global attributes are accepted.
Minimal line chart for inline sparkline use.
Attrs
data— list of numberscolor— line stroke colorcurve— interpolation mode (:linear, :smooth, :monotone)stroke_width— line width in px
Attributes
data(:list) (required) - List of numeric values.color(:string) - Line stroke color. Defaults to"oklch(0.60 0.20 240)".curve(:atom) - Interpolation. Defaults to:linear. Must be one of:linear,:smooth, or:monotone.stroke_width(:any) - Stroke width. Defaults to2.show_animation(:boolean) - Enable draw animation. Defaults tofalse.animate_duration(:integer) - Animation duration in ms. Defaults to900.class(:string) - Defaults tonil.- Global attributes are accepted.