Charge session

Pro

An EV or device charging card. Energy packets flow from a charger along the cable into the battery pack, which fills toward a draggable charge limit. The charge curve tapers near full, and power, energy, time to limit and cost update live. Stop charging drains the flow.

Live · keyboard ready

Fast charger 4

Harbor Street hub, 150 kW

34%Charging
80%
Charge curve
Power
150 kW
Energy added
0.0 kWh
Time to 80%
23 min
Cost
$0.00

Drag across the pack or the curve to set the charge limit.

  • An EV or fleet app that shows a live charging session with a charge limit.
  • A charge point operator console where staff watch power, energy and cost for one bay.
  • A product page that demonstrates how your charging network reports time to full and cost.
  • Use usage-meter or progress for a static quota or a simple percentage.
  • Use gauge for a single live reading without a session, curve or cost.
  • Use a table or a chart block to compare many sessions at once.

Installation

Pro source and install commands unlock with a Pro plan.

example.tsx
import { ChargeSession } from "@/components/arc/charge-session/charge-session"; export function DepotCharger() {  return (    <ChargeSession      title="Bay 12, depot charger"      location="North yard, 350 kW"      capacity={98}      maxPower={350}      startCharge={22}      defaultLimit={85}      rate={0.38}      currency="EUR"      locale="de-DE"      onLimitChange={limit => api.setChargeLimit("bay-12", limit)}      onStateChange={(state, detail) => state === "stopped" && api.stopSession("bay-12", detail)}    />  );}

ChargeSession

A live charging session card for an EV or any device. Energy packets travel from a brushed metal charger along the cable and through the pack to the fill front, where each one lands. The pack fills toward a draggable charge limit, the charge curve tapers near full with the live point riding on it, and power, energy added, time to limit and cost roll every frame. Stop charging drains the flow: the power falls to zero, the last packets land and the point drops to the baseline.

PropTypeDefaultDescription
titlestring"Fast charger 4"Name of the charger or device, shown as the card heading.
locationstring"Harbor Street hub, 150 kW"Secondary line under the title. Pass an empty string to hide it.
capacitynumber77Usable battery capacity in kWh. Sets how fast the pack fills and how much energy each percent is worth.
maxPowernumber150Peak charging power in kW, reached on the flat part of the curve.
startChargenumber34State of charge in percent when the session starts, and where Start new session returns to.
defaultLimitnumber80Charge limit in percent to start with. The component owns it after mount; read it with onLimitChange.
minLimitnumber50Lowest limit the marker can be set to, in percent.
taperAtnumber50State of charge in percent where the power starts to taper toward full.
ratenumber0.42Price per kWh in the session currency.
currencystring"USD"ISO 4217 currency code for the cost.
localestring"en-US"Locale used to format the cost.
speednumber1Multiplies simulated time. At 1, one second on screen is forty seconds of charging. 0 holds the session still while the flow keeps moving.
pausedbooleanfalseHolds the session and the flow on their current frame. The limit and the button still work.
accentstring–Any CSS color for the energy, the fill and the traveled curve. Defaults to the accent.
onStateChange(state: "charging" | "stopped" | "complete", detail: ChargeSessionDetail) => void–Called when charging stops, resumes, reaches the limit or a new session starts, with the charge, energy, cost and limit at that moment.
onLimitChange(limit: number) => void–Called with the new limit in percent when a drag or key press settles.
labelstring–Accessible name of the card. Defaults to the title.
classNamestring–Class on the root element.
styleCSSProperties–Inline styles on the root element.
  • The card is a labelled group with a real heading. Power, energy added, time to limit and cost are a description list, so each value is read with its name.
  • The limit marker is a focusable role="slider" named Charge limit, with aria-valuetext such as Charge limit 80%, about 23 minutes to go. Arrows move it by 1%, Shift with an arrow or Page Up and Page Down by 10%, Home and End jump to the minimum and to 100%. The drag hint is linked with aria-describedby.
  • Stopping, resuming, reaching the limit, starting a new session and a settled limit change are announced in a polite live region with the charge, energy and cost at that moment.
  • The action button keeps one accessible label at a time (Stop charging, Resume charging, Start new session) and its width never changes.
  • The scene and the curve plot are hidden from assistive technology; every value they show is also in the stats, the header or the slider.
  • State never relies on color: the header pairs an icon with Charging, Stopped or Charged to limit, and time to limit reads Paused or Done.
  • One requestAnimationFrame loop advances the session and writes SVG attributes, CSS variables and text directly; React renders only when the session state changes.
  • Packets move along an arc length table of the cable curve, so they travel at an even pace, ease out of the charger, glide through the nub and slow as they meet the fill front, where each landing briefly brightens the front.
  • Power follows the charge curve times an availability level that ramps up on start and drains exponentially on stop, so the numbers, the LED, the cable core, the packet pace and the live point on the curve all fall away together.
  • Dragging the limit is one to one with the pointer; the pill lifts slightly while held. Raising the limit after the pack is full resumes charging, lowering it below the charge completes the session.
  • The loop stops offscreen, in background tabs, when paused, and once the flow has fully drained.
  • With reduced motion the session holds still: packets sit at even spacing along the path to show direction, values are current, and stop, resume and the limit all update at once.
  • The scene is one SVG with a fixed aspect ratio that scales to any width, so the charger, cable and pack keep their proportions; the limit pill is HTML placed in container units, so its text and 44px touch target keep their real size.
  • The curve stretches to its container with non scaling strokes; its labels and live point are HTML so they stay crisp and round.
  • Above 640px the curve sits beside a two by two stats grid and the percentage grows to the display size. Below 420px padding tightens, the stats shrink one step and the action button spans the card.
  • Dragging uses touch-action pan-y on the scene and the curve, so vertical page scroll still works on phones.
  • A frame evaluates the power curve, a 48 step time to limit integral and 18 packets, well under a millisecond.
  • Every write goes through a cache, so unchanged attributes and text are never touched; pointer math reads the target rectangle once per press.
  • No canvas, no layout reads in the loop, and the loop idles completely once the flow has drained.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use it for EV charging apps, fleet and depot dashboards, charge point operator consoles, or any device charging flow where time to full and cost matter.
  • The session is simulated from capacity, maxPower, taperAt and rate. For a real session, map your live state of charge onto startCharge and keep speed low, or say clearly that the view is an estimate.
  • Keep the title to the charger or vehicle name and put the site and peak power in location.
  • Stopping in the demo is local; wire onStateChange to your backend before calling it a real stop.

The full library index for assistants is at /llms.txt.