Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelogContact
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCountry SelectCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputEmoji PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone SelectTree Select
Forms
Address InputBooking WidgetCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage CropperImage GalleryImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadChat WidgetConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeTerminalText AnimateText Rotate
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowOrder History PagePost Listing WizardPricing PageProfile PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAgency PageAI Product PageAppointment Booking PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageHome Services PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePortfolio PagePress PageProduct Tour PagePromo PageReal Estate PageReferral PageResearch Report PageRestaurant PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageStorefront PageSwitch PageTemplate Gallery PageTravel PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Charts & Stats

Area chart

Charts & Stats

Area chart React component for Tailwind CSS v4

Animated CounterBar chart
Live props
Appearance
type
fill
fillOpacity0.22
showLine
curve
strokeWidth2px
showGrid
surface
Behavior
connectNulls
legendToggle
showTooltip
tooltipMode
animated
Layout
height240px
showXAxis
showYAxis
yAxisSide
showLegend
legendPosition
Content
valueFormat
currency
locale
label
description
State
loading
Code
import { AreaChart } from "@/components/ui/area-chart"

<AreaChart />
  1. Home
  2. Components
  3. Charts & Stats
  4. Area chart
Pro

Area chart React component for Tailwind CSS v4

v1.0.0·Added in 1.0.0

Volumes over time as filled areas: overlapping gradients, stacked bands for parts of a total, or 100% stacked shares.

Move the mouse over the plot for a crosshair, a dot on every band and a readout of every visible series (stacked charts list the top band first and add a Total row; percent charts show the value and its share, "$48,920 · 38.1%"). On a phone, tap a month to pin the readout above your finger, drag sideways to scrub (vertical drags still scroll the page), tap the same month again or anywhere outside to clear it. With the keyboard, Tab to the plot, then Left / Right walk the points, Home / End jump to the ends, PageUp / PageDown move by ten, Enter fires onDatumClick, Escape clears; a live region reads each point. Legend entries are buttons: click or tap one to hide or show its series (the stack re-flows with a glide), hover or focus one to highlight it. Switching type between overlap, stacked and percent glides the areas to their new shape and cross-fades the y ticks. Areas rise from the baseline and the lines draw in the first time the chart scrolls into view; reduced motion shows the final chart at once.

Area chart is a Pro React component in the React chart and stat components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add area-chart, together with Chart kit, Motion presets, UIProvider and useLocale and the npm packages motion, d3-shape and d3-scale.

Add to a project

Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add area-chart

Area chart is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans

Usage

Import AreaChart from @/components/ui/area-chart.

import { AreaChart } from "@/components/ui/area-chart"

const data = [
  { month: "2026-07", direct: 41460, online: 28700, partners: 18070 },
  { month: "2026-08", direct: 38030, online: 27300, partners: 15600 },
  { month: "2026-09", direct: 48920, online: 36400, partners: 22130 },
]

export function RevenueByChannel() {
  return (
    <AreaChart
      data={data}
      xKey="month"
      series={[
        { key: "direct", label: "Direct sales" },
        { key: "online", label: "Online store" },
        { key: "partners", label: "Partners" },
      ]}
      type="stacked"
      valueFormat="currency"
      currency="USD"
      label="Revenue by channel, 2026"
    />
  )
}

Props

  • data*
    ChartDatum[]

    One row per x position: { month: "2026-09", direct: 48920, online: 36400 }. Data order is x order (the chart does not sort).

  • xKeydefault "date"
    string

    The row key for the x axis. ISO days ("2026-09-24") and months ("2026-09") print as local dates.

  • series
    AreaChartSeries[]

    Which keys to draw ({ key, label?, color?, name? }), in color and stack order: series 1 is the bottom band. Inferred from the numeric keys of the first rows when omitted.

  • colors
    string[]

    Per-position palette overrides: slots ("series-3"), tones ("neutral", "brand", "success") or any css color.

  • typedefault "overlap"
    "overlap" | "stacked" | "percent"

    overlap: every area from zero, the first series on top. stacked: bands add up (negative values stack below zero, diverging). percent: 100% stacked shares, y axis 0 to 100 %, the readout and table add each share with one decimal ("38,1 %"), negatives drawn as 0.

  • filldefault "gradient"
    "gradient" | "solid" | "none"

    gradient fades the series color from fillOpacity to transparent; solid is a flat fill at fillOpacity; none draws lines only (always on, whatever showLine says).

  • fillOpacitydefault 0.22
    number

    The top of the gradient or the solid fill. Stacked bands add 0.1 so they read as bands; overlapping fills of two or more series never exceed 0.22.

  • showLinedefault true
    boolean

    The line on each area's top edge. Stacked bands keep a thin surface gap between them without it.

  • curvedefault "monotone"
    "monotone" | "linear" | "natural" | "step"

    How points are joined. monotone never overshoots the data.

  • strokeWidthdefault 2
    number

    Width of the top lines in px.

  • connectNullsdefault false
    boolean

    Bridge null gaps instead of breaking the area (overlap only; stacked types treat nulls as 0).

  • heightdefault 240
    number

    Plot height in px, reserved before measuring so nothing jumps. The width always fills the parent.

  • valueFormatdefault "number"
    ChartValueFormat = "number" | "compact" | "currency" | "percent"

    How values print in the readout, the ticks and the table: "128,450", "128K", "$128,450", "12.4%" (percent takes whole numbers). Ticks go compact on their own from 10,000.

  • currencydefault "USD"
    string

    ISO 4217 code for valueFormat="currency", printed with its narrow symbol ("$", "€"). Anything that is not a three-letter code prints as plain numbers with the text as a suffix.

  • decimals
    number

    Fraction digits in the readout and the table (ticks stay short). Auto by magnitude.

  • formatValue
    (value: number, context: { series: string; kind: "tooltip" | "tick" | "label" | "table" }) => string

    Full control over value text, e.g. v => `${v} units`. Percent ticks and shares keep the kit format.

  • formatX
    (value: unknown, context: "axis" | "tooltip" | "table") => string

    x labels; default formatChartLabel ("Sep" on the axis, "September 2026" in the readout).

  • localedefault ""
    string

    Intl locale for numbers and dates; empty uses UIProvider's locale, then the page's.

  • yDomaindefault "["auto", "auto"]"
    AreaChartDomain = [number | "auto", number | "auto"]

    Fixed value bounds. Areas always include zero; percent charts are always 0 to 100.

  • showGriddefault true
    boolean

    Hairlines at the value ticks.

  • showXAxisdefault true
    boolean

    x labels under the plot, thinned from the newest backwards so they never collide.

  • showYAxisdefault true
    boolean

    Value tick labels.

  • yAxisSidedefault "start"
    "start" | "end"

    end puts the value ticks on the right (finance style).

  • showLegenddefault true
    boolean

    The legend; only rendered with two or more series (one series is named by the card title).

  • legendPositiondefault "top"
    "top" | "bottom"

    Legend above or below the plot. It wraps on narrow widths.

  • legendToggledefault true
    boolean

    Legend entries are buttons that hide and show their series (the last visible series cannot be hidden).

  • showTooltipdefault true
    boolean

    The floating readout. When off, the crosshair, keyboard and live region still work.

  • tooltipModedefault "auto"
    "auto" | "float" | "fixed"

    float rides beside the crosshair, fixed pins above the plot; auto is fixed on touch screens.

  • referenceLines
    { value: number; label?: string; color?: string }[]

    Dashed targets or averages ("Media 261"). In percent charts the value is a share (0 to 100).

  • animateddefault true
    boolean

    Areas rise and lines draw the first time the chart scrolls into view; data, type and legend changes glide.

  • loadingdefault false
    boolean

    A skeleton in the plot's shape, same height.

  • emptyState
    ReactNode

    Shown when data is empty or every value is null. Default: an icon tile and labels.empty.

  • labeldefault ""
    string

    Accessible name of the figure and caption of its data table. Empty joins the series names.

  • descriptiondefault ""
    string

    A one-sentence takeaway for screen readers (aria-describedby).

  • surfacedefault ""
    string

    The color behind the chart, used for dot rings and the gaps between stacked bands. Empty = var(--surface).

  • hiddenSeries
    string[]

    Hidden series keys (controlled). Pair with onHiddenSeriesChange.

  • defaultHiddenSeriesdefault "[]"
    string[]

    Series hidden at first (uncontrolled).

  • onHiddenSeriesChange
    (keys: string[]) => void

    Called when a legend toggle hides or shows a series.

  • activeIndex
    number | null

    The inspected x index (controlled), so two charts can share one crosshair.

  • defaultActiveIndexdefault "null"
    number | null

    The inspected index at first (uncontrolled).

  • onActiveIndexChange
    (index: number | null) => void

    Called while hovering, scrubbing or walking with the keyboard.

  • onDatumClick
    (event: { index: number; datum: ChartDatum; series?: string }) => void

    A click on the plot (series = the band under the pointer) or Enter on the inspected point (series = the first visible one).

  • labels
    Partial<AreaChartLabels>

    English defaults: empty, loading, table, total, other, inspectHint, showSeries, hideSeries and shareColumn (the percent table's share column).

  • classNames
    Partial<Record<"legend" | "plot" | "tooltip" | "table" | "area" | "line" | "dot" | "grid" | "xAxis" | "yAxis", string>>

    Extra classes for the inner parts.

  • className
    string

    Extra classes for the figure root, merged last.

Parts

  • DEFAULT_AREA_CHART_LABELS

    constant

    The English strings the chart uses (empty and loading text, the data table, the keyboard hint, show and hide series, the share column of a percent chart). Spread it and override what you translate.

  • AreaChartLabels

    type

    The shape of labels: the chart kit's shared strings plus shareColumn(series) for the percent table.

  • AreaChartSeries

    type

    One drawn key: { key, label?, color?, name? }, in color and stack order.

Examples

Overlap of two

Collected vs. expenses as overlapping gradients.

100% stacked

Channel shares per month, y axis 0 to 100%.

Solid bands, no lines

Stock per warehouse, weekly, with a custom value format.

Neutral with an average

A single monochrome area and a dashed reference line.

Loading and empty

The skeleton and the empty state keep the plot's height.

Phone

Five stacked series at 360px with the pinned readout.

Dependencies

motiond3-shaped3-scalechart-kitmotionui-configuse-locale

Files

  • components/ui/area-chart.tsx

FAQ

Is the React Area chart component free?

The preview, props and docs are free; copying the source needs a Pro plan. See plans.

How do I install Area chart?

Run npx wingo-ui@latest add area-chart. It also adds the Wingo UI items it builds on (Chart kit, Motion presets, UIProvider and useLocale) and the npm packages motion, d3-shape and d3-scale. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/area-chart.

How does Area chart behave on phones?

On a phone, tap a month to pin the readout above your finger, drag sideways to scrub (vertical drags still scroll the page), tap the same month again or anywhere outside to clear it.

See also

Line chartBar chartDonut chartChart kitlibSegmented Control

Used in

Admin Dashboard Page

More React chart and stat components

Funnel chartRadar chartTrend badgeGaugeGitHub ActivityAnimated Counter
All 16 React chart and stat components

Articles using this component

  • React Charts Tailwind: 4 Charts and a Kit for Any Theme

    Component guides · Oct 19, 2026 · 10 min read

  • Best React Component Library for Dashboard Apps in 2026

    Comparisons and alternatives · Oct 16, 2026 · 13 min read

PreviousAnimated CounterNext Bar chart

Revenue by channel, 2026

Summit CRM, January – September. Hover, tap or focus the chart and use the arrow keys.

Direct sales, Online store, Partners, Public tenders, Other
Direct salesOnline storePartnersPublic tendersOther
January 202636,21018,52015,1609,2605,050
February 202638,56021,11016,52010,1005,510
March 202637,13021,22015,03010,6104,410
April 202642,07025,65017,44011,2906,150
May 202644,36028,83019,96011,0906,660
June 202639,48025,66016,78010,8605,920
July 202641,46028,70018,07011,6906,380
August 202638,03027,30015,60010,7305,840
September 202648,92036,40022,13013,6007,400

type: overlap · tooltip: auto · legend toggle: on · connect nulls: off · draw-in: on