Tessina UI
ConfiguratorGitHubIntroduction
InstallationUsageTheming
ComponentsAccordionAction SheetAlertAlertDialogArea ChartAspectRatioAvatarBadgeBannerBar ChartBottom NavBreadcrumbButtonButtonGroupCalendarCardCarouselChartChatBubbleCheckboxChipCodeBlockCollapsibleColor PickerComboboxCommandContainerContextMenuDate PickerDividerDrawerDropdown MenuEmptyStateFABFieldFieldsetFile UploadFile Upload 2FlexFormGridHoverCardIconButtonLabelLine ChartLinkMenubarMeterModalNavigation MenuNumberFieldOTP InputPaginationPie ChartPopoverProgressPromptInputRadar ChartRadial ChartRadioRatingScroll AreaSearchSegmentedControlSelectShortcutSidebarSkeletonSliderSpacerSpinnerSplit ButtonStackStatusStepperSurfaceSwitchTableTabsTextareaTime PickerToastToggleButtonToggleGroupToolbarTooltipTop Header DesktopTop Header Mobile
Contributing
Components

Line Chart

Token-driven line chart built on Recharts v3 with single and multi-series support, point markers, dashed strokes for non-color differentiation, and full light/dark theming.

Playground

Installation

pnpm add @tessinaui/ui recharts

Usage

import { LineChart } from "@tessinaui/ui";
import type { ChartConfig } from "@tessinaui/ui";

const config: ChartConfig = {
  revenue: { label: "Revenue", color: "var(--chart-1)" },
  expenses: { label: "Expenses", color: "var(--chart-3)" },
};

const data = [
  { month: "Jan", revenue: 4200, expenses: 2400 },
  { month: "Feb", revenue: 3800, expenses: 2210 },
  { month: "Mar", revenue: 5100, expenses: 2290 },
];

<LineChart
  data={data}
  config={config}
  categoryKey="month"
  dashedSeries={["expenses"]}
/>

Examples

Default

A smooth, single-series line with a natural curve.

Multiple

Two series in brand tones; expenses dashed so it stays distinct without color.

Curve

The four interpolation modes — monotone, natural, linear, and step.

Sizes

Three aspect ratios — sm (short/wide), md, and lg (tall).

Dots & labels

Point markers on every value, or the value printed above each point.

States

Loading skeleton and empty state.

Non-color differentiation

Colour alone is unreliable for colour-vision-deficient readers. LineChart ships two encodings you can layer on top of colour:

  • Point markers (showDots, on by default) give each line a distinct dotted trail.
  • Dashed strokes (dashedSeries={["expenses"]}) render specific series with a dash pattern.

Combine them with the legend and tooltip so a series can always be identified without colour.

Theming

ElementToken
Series stroke / marker--chart-1 … --chart-6 (via config[key].color)
Grid + axis linesborder
Axis tick labelsmuted-foreground
Tooltip surfacepopover / popover-foreground / border

Accessibility

  • accessibilityLayer on: keyboard navigation across data points + screen-reader summary.
  • Animation respects prefers-reduced-motion: reduce.
  • Pair colour with markers / dashes / direct labels for colour-independent reading.

Core props

PropTypeDefaultDescription
dataRecord<string, string | number | null>[]—Row-per-category data.
configChartConfig—Series metadata (label, color).
categoryKeystring—Datum key for the x-axis.
seriesstring[]all config keysWhich series to plot.
curve"monotone" | "linear" | "step""monotone"Interpolation.
size"sm" | "md" | "lg""md"Aspect ratio.
showGrid / showLegend / showXAxis / showYAxis / showTooltip / showDotsboolean—Toggle chart chrome.
dashedSeriesstring[][]Series keys rendered with a dashed stroke.
dir"ltr" | "rtl""ltr"Reading direction.
loadingbooleanfalseRender the skeleton.
errorReactNode—Render an error message instead of the chart.
emptyStateReactNode"No data to display"Shown when data is empty.

Label

A foundational form label primitive. Five sizes, five intents, three tones, three weights, required/optional indicators, leading/trailing icons, optional description, and RTL support.

Link

A semantic anchor primitive for navigation, inline prose, and CTAs. Three variants, five sizes, five intents, three tones, configurable underline, external link handling, leading/trailing icons, and RTL support.

On this page

PlaygroundInstallationUsageExamplesDefaultMultipleCurveSizesDots & labelsStatesNon-color differentiationThemingAccessibilityCore props