OverviewGetting startedComponentsIconsGuidesExamples
OverviewGetting startedComponentsIconsGuidesExamples
GitHub repositoryJoin the c2n-webcomponents Discord

Depth chart

Cumulative bid and ask size around the mid price of an order book, as trading screens show market depth.

Attributes

NameTypeDefaultDescription
bidsDepthLevelInput[] | undefined—Bid levels, [price, size] pairs or { price, size } rows, in any order. A size of 0 is ignored.
asksDepthLevelInput[] | undefined—Ask levels, in the same shapes as bids.
rangenumber0.02How far either side of the mid price the chart reaches, as a fraction of it: 0.02 shows ±2%.
midnumber | undefined—The centre of the chart, such as an index or mark price. Defaults to the midpoint of the best bid and best ask.
unit'base' | 'quote'baseWhether the curves sum size in the base currency or notional (price × size) in the quote currency.
curve'step' | 'linear'stepstep draws each level as a step, as exchanges do; linear joins the levels directly.
mirrorbooleantrueMarks the same distance from the mid price on the other side while hovering, and adds it to the tooltip.
base-labelstring—Name of the base currency (BTC), printed after sizes.
quote-labelstring—Name of the quote currency (USD), printed after prices and notionals.
price-precisionnumber | undefined—Decimals of a price. Defaults to the most any input price carries.
size-precisionnumber | undefined—Decimals of a size. Defaults to the most any input size carries, at most 8.
grid'both' | 'x' | 'y' | 'none'yWhich grid lines are drawn. A string rather than a boolean because a boolean attribute reads as true whenever it is present — grid="false" in markup would turn the grid on, and there would be no way to turn it off from HTML at all. y (the default) draws the horizontal lines, matching axes' shape.
axes'both' | 'x' | 'y' | 'none'bothWhich axes are drawn.
y-minnumber | undefined—Lower bound of the y scale. Auto-ranged when unset.
y-maxnumber | undefined—Upper bound of the y scale. Auto-ranged when unset.
zoombooleanfalseLets the user drag horizontally to zoom the x scale.
cursor'x' | 'none'xThe cursor crosshair.
dataChartInput | undefined—The data to plot. Row objects, a bare number[], columnar [xs, ys…], or an already-normalised frame. Compared by identity: replace the array, or bump revision after mutating it in place.
revisionnumber0Bump after mutating data in place. The cheap escape hatch for a large buffer you own.
seriesChartSeriesConfig[] | undefined—Series definitions, as an alternative to c2-chart-series children. Children win when both are set.
x-fieldstring—Row field holding the x value; may be a dotted path. Defaults to the row index.
label-fieldstring—Row field holding each row's label: the slice names of a pie, the category axis of a bar chart, and the x tick labels of a line, area or sparkline chart (label-field="month", or "year" to print 2021 rather than 2,021).
x-type'time' | 'linear' | 'category'linearHow x values are interpreted, which decides the axis and the tooltip format.
legend'none' | 'top' | 'bottom' | 'start' | 'end'bottomWhere the legend sits, or none to hide it. Shown by default: a chart with more than one series is unreadable without one, and a single-series chart simply renders a one-entry legend.
legend-action'toggle' | 'highlight'highlightWhat clicking a legend entry does. highlight (the default) emphasises the series and dims the others, and a second click clears the highlight, just as a click on the series in the plot does; toggle hides or shows the series instead. A linked c2-chart-legend follows the same mode.
highlightedstring | nullnullKey of the series drawn emphasised, the others dimmed: the series field, or a pie's slice label, or an overlap chart's set key. Set by a legend click in highlight mode, and settable from the application in either mode.
tooltip'none' | 'item' | 'axis'axisWhether the tooltip follows the whole x position or only the hovered datum.
animation'none' | 'auto'autoWhether the chart animates its initial draw. ECharts uses its native shape animation and uPlot uses a lightweight plot reveal; subsequent data updates stay immediate so a live source does not animate every tick. Named animation rather than animate because HTMLElement.animate() is a method every element already has, and shadowing it breaks the Web Animations API on the host.
localestring | undefined—BCP 47 locale for the axis and tooltip formatting. Defaults to the browser locale.
loadingbooleanfalseShows the loading state instead of the plot.
errorstring—Shows an error message instead of the plot.
empty-messagestringNo dataReplaces the built-in "no data" text.
max-pointsnumber0Caps how many points a streaming chart keeps; older points fall off the front. 0 keeps everything.
lazy-renderbooleanfalseDefers loading the engine until the host first scrolls into view.
annotationsChartAnnotation[] | undefined—Markers at an x value and shaded x ranges, drawn over the plot of a cartesian chart (line, area, bar, sparkline, scatter, bubble, candlestick) and placed by the engine's own x scale, so they follow the axes, a resize and a zoom. x/x2 are x values: what x-field holds (epoch milliseconds on a time chart), else the row index. Each marker is a button, reachable with Tab and named by its label and x, that fires annotation-click. The other charts (pie, gauge, radar, pyramid, butterfly, heatmap, overlap, chord, map) ignore it.

Slots

NameDescription
defaultThe series definitions: c2-chart-series elements. They render nothing themselves.
legendReplaces the built-in legend. The built-in one is still what legend positions.
tooltipReplaces the built-in tooltip body. The hovered point is available through the renderTooltip property when a function is easier than markup.
actionsControls pinned to the top-right of the plot area, for a range picker or an export button.
emptyReplaces the built-in "no data" message.
loadingReplaces the built-in message shown while loading is set.
errorReplaces the built-in message shown when error is set.

Events

NameTypeDescription
price-selectCustomEvent<DepthReadout>Fired when a price is clicked, or picked with Enter: the price, its side, the cumulative size and notional to it, the average fill price and the price impact. Does not bubble.
range-changeCustomEvent<ChartRangeEventDetail>Fired after the user zooms or brushes. detail.min and detail.max are the new x bounds. Does not bubble.
tooltip-changeCustomEvent<ChartTooltipContext | null>Fired with the complete tooltip model as the pointer moves, and with null when it leaves. Used by c2-chart-tooltip.
series-toggleCustomEvent<ChartSeriesToggleEventDetail>Fired when a series is hidden or shown, from the legend with legend-action="toggle" or through setSeriesVisible. Does not bubble.
series-highlightCustomEvent<ChartSeriesHighlightEventDetail>Fired when the reader highlights a series, from the legend or by clicking it in the plot, or clears the highlight. detail.key names it, or is null. Does not bubble.
legend-changeCustomEvent<ChartLegendChangeEventDetail>Fired when legend entries or visibility change. Used by c2-chart-legend.
chart-readyCustomEvent<{ engine: string }>Fired after the engine has loaded and drawn for the first time. The host also matches :state(ready) from then on, which is what a test should wait on.
chart-errorCustomEvent<{ error: unknown }>Fired when the engine fails to load or to draw. detail.error is the underlying failure.
point-hoverCustomEvent<ChartPointEventDetail | null>Fired as the pointer moves between data points, and with a null detail when it leaves the plot. Does not bubble.
annotation-clickCustomEvent<ChartAnnotationEventDetail>Fired when an annotation's marker is clicked, or activated from the keyboard. detail.annotation is the entry and detail.index its position in annotations. Does not bubble.
point-clickCustomEvent<ChartPointEventDetail>Fired when a datum is clicked; the chart then highlights the clicked series (a second click on it clears the highlight). Cancelable: preventDefault() keeps the highlight as it is. Does not bubble: several components fire point events, so a listener belongs on the element itself.

CSS parts

Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.

NameDescription
mirror-markerThe marker at the same distance from the mid price on the other side, while hovering.
focus-markerThe marker on the level reached with the arrow keys.
frameThe outer flex column holding the legend and the plot area.
plot-areaThe positioned box the engine draws into.
plotThe engine's container element. Carries no Lit bindings, so the canvas survives every update.
overlayThe non-interactive layer above the canvas that holds the tooltip and the actions.
tooltipComponent-owned bubble containing the tooltip slot and its generated fallback content.
actionsThe container for the actions slot.
annotationsThe layer holding the annotations, above the plot and below the tooltip.
annotationOne annotation: the box from x to x2, or a zero-width box at x.
annotation-rangeThe shaded fill of a range annotation.
annotation-lineThe rule drawn at an annotation's x.
annotation-markerThe focusable button at the top of an annotation's rule.
stateShared message layer containing the empty, loading, or error slot and its fallback state.
legendComponent-owned container wrapping the legend slot and generated legend fallback.
legend-itemOne legend entry, a toggle button.
legend-markerThe colour swatch inside a legend entry.

CSS custom properties

Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.

NameTypeDefaultDescription
c2-chart
--c2-chart--widthlength100%Width of the host. The plot is absolutely positioned and has no intrinsic width, so a chart used as a flex item would otherwise collapse to its legend.
--c2-chart--heightpixel320pxHeight of the host. A canvas has no intrinsic size, so this is what gives the chart a box.
--c2-chart--backgroundcolor#ffffffBackground of the chart surface.
--c2-chart--colorcolor#18181bPrimary text colour.
--c2-chart--font-familyfont-familyinheritFont family used for the chart chrome and the labels the engine draws.
--c2-chart--font-sizefont-size12pxBase font size.
--c2-chart--paddingpadding12pxPadding around the whole chart.
--c2-chart--border-topborder1px solid #e4e4e7Top border.
--c2-chart--border-rightborder1px solid #e4e4e7Right border.
--c2-chart--border-bottomborder1px solid #e4e4e7Bottom border.
--c2-chart--border-leftborder1px solid #e4e4e7Left border.
--c2-chart--border-top-left-radiusborder-radius8pxTop-left corner radius.
--c2-chart--border-top-right-radiusborder-radius8pxTop-right corner radius.
--c2-chart--border-bottom-left-radiusborder-radius8pxBottom-left corner radius.
--c2-chart--border-bottom-right-radiusborder-radius8pxBottom-right corner radius.
c2-chart > bid
--c2-chart__bid--colorcolor#16a34aColour of the bid curve and its fill. Falls back to --c2-chart__positive--color.
c2-chart > ask
--c2-chart__ask--colorcolor#dc2626Colour of the ask curve and its fill. Falls back to --c2-chart__negative--color.
c2-chart > area
--c2-chart__area--opacityopacity0.15Opacity of the fill under each curve.
c2-chart > line
--c2-chart__line--widthpixel2pxStroke width of the two curves.
c2-chart > grid
--c2-chart__grid--widthpixel1pxWidth of the grid lines.
--c2-chart__grid--colorcolor#e4e4e7Colour of the grid lines.
c2-chart > mid-line
--c2-chart__mid-line--colorcolor#a1a1aaColour of the dashed line at the mid price.
c2-chart > mid-label
--c2-chart__mid-label--background-colorcolor#18181bBackground of the mid price label.
--c2-chart__mid-label--colorcolor#fafafaText colour of the mid price label.
c2-chart > mirror-marker
--c2-chart__mirror-marker--sizepixel8pxDiameter of the mirror and focus markers.
--c2-chart__mirror-marker--background-colorcolor#ffffffFill of the mirror marker, ringed in the other side's colour.
c2-chart > plot
c2-chart > plot > focus
--c2-chart__plot__focus--outlineoutline2px solid rgba(2, 101, 220, 0.4)Focus ring of the plot, the chart's tab stop.
c2-chart > axis-line
--c2-chart__axis-line--colorcolor#e4e4e7Colour of the tick marks uPlot draws along each axis at the plot edges.
c2-chart > series
c2-chart > series > dimmed
--c2-chart__series__dimmed--opacityopacity0.25Opacity the other series (or slices) keep while one is highlighted.
c2-chart > series-1
--c2-chart__series-1--colorcolor#0265dcColour of the first series.
c2-chart > series-2
--c2-chart__series-2--colorcolor#ea580cColour of the second series.
c2-chart > series-3
--c2-chart__series-3--colorcolor#0f766eColour of the third series.
c2-chart > series-4
--c2-chart__series-4--colorcolor#db2777Colour of the fourth series.
c2-chart > series-5
--c2-chart__series-5--colorcolor#a16207Colour of the fifth series.
c2-chart > series-6
--c2-chart__series-6--colorcolor#7c3aedColour of the sixth series.
c2-chart > series-7
--c2-chart__series-7--colorcolor#0891b2Colour of the seventh series.
c2-chart > series-8
--c2-chart__series-8--colorcolor#52525bColour of the eighth series. Series beyond the eighth reuse the palette from the start.
c2-chart > axis
--c2-chart__axis--colorcolor#71717aColour of the axis lines and tick labels.
--c2-chart__axis--font-sizefont-size12pxFont size of the tick labels.
c2-chart > crosshair
--c2-chart__crosshair--colorcolor#a1a1aaColour of the cursor crosshair.
--c2-chart__crosshair--widthpixel1pxWidth of the cursor crosshair.
c2-chart > surface
--c2-chart__surface--colorcolor#ffffffSurface colour handed to the engine, for marker borders and label backdrops.
c2-chart > muted
--c2-chart__muted--colorcolor#71717aSecondary text colour.
c2-chart > positive
--c2-chart__positive--colorcolor#16a34aColour for a rising value, used by the candlestick chart and as the sparkline's positive tone.
c2-chart > negative
--c2-chart__negative--colorcolor#dc2626Colour for a falling value, used by the candlestick chart and as the sparkline's negative tone.
c2-chart > legend
--c2-chart__legend--gappixel12pxGap between legend entries.
--c2-chart__legend--paddingpadding8px 0 0Padding around the legend.
--c2-chart__legend--colorcolor#71717aLegend text colour.
--c2-chart__legend--font-sizefont-size12pxLegend font size.
c2-chart > legend > disabled
--c2-chart__legend__disabled--opacityopacity0.38Opacity of the legend entries that are not highlighted while one is, or, with legend-action="toggle", of an entry whose series is hidden.
c2-chart > legend-marker
--c2-chart__legend-marker--sizepixel10pxSize of the legend colour swatch.
--c2-chart__legend-marker--border-radiusborder-radius999pxCorner radius of the legend colour swatch.
c2-chart > tooltip
--c2-chart__tooltip--background-colorcolor#18181bTooltip background.
--c2-chart__tooltip--colorcolor#fafafaTooltip text colour.
--c2-chart__tooltip--font-sizefont-size12pxTooltip font size.
--c2-chart__tooltip--paddingpadding8px 10pxTooltip padding.
--c2-chart__tooltip--border-radiusborder-radius6pxTooltip corner radius.
--c2-chart__tooltip--box-shadowbox-shadow0 8px 24px rgba(24, 24, 27, 0.08)Tooltip shadow.
--c2-chart__tooltip--gappixel6pxGap between tooltip rows.
c2-chart > annotation
--c2-chart__annotation--colorcolor#71717aColour of a neutral annotation (the default tone).
c2-chart > annotation > info
--c2-chart__annotation__info--colorcolor#0265dcColour of an info annotation.
c2-chart > annotation > success
--c2-chart__annotation__success--colorcolor#16a34aColour of a success annotation.
c2-chart > annotation > warning
--c2-chart__annotation__warning--colorcolor#d97706Colour of a warning annotation.
c2-chart > annotation > danger
--c2-chart__annotation__danger--colorcolor#dc2626Colour of a danger annotation.
c2-chart > annotation-range
--c2-chart__annotation-range--opacityopacity0.12Opacity of the shaded fill of a range annotation.
c2-chart > annotation-line
--c2-chart__annotation-line--border-widthpixel1pxWidth of an annotation's rule.
--c2-chart__annotation-line--border-styleborder-styledashedStyle of an annotation's rule.
c2-chart > annotation-marker
--c2-chart__annotation-marker--sizepixel10pxDiameter of an annotation's marker.
--c2-chart__annotation-marker--border-colorcolor#ffffffRing drawn around a marker, so it stands out from the bars or lines behind it.
c2-chart > annotation-marker > focus
--c2-chart__annotation-marker__focus--outlineoutline2px solid #0265dcFocus ring of a marker.
c2-chart > state
--c2-chart__state--colorcolor#71717aColour of the empty, loading and error text.
--c2-chart__state--font-sizefont-size14pxFont size of the empty, loading and error text.
AccordionConnected, animated panels with shared borders and single or multiple expansion.LayoutAction BarA floating bar for the current selection: the count, the bulk actions and a button that clears it.LayoutApp ShellThe frame of an application: header, navigation, main, an optional details panel, banner and footer, laid out from its own width.LayoutArea chartA line chart with the region under each line filled — every line-chart attribute, plus a fill opacity.ChartAttachmentFile and image attachments with metadata, upload progress, failure states, and actions.Data displayAutocompleteSearchable combobox for local or remote items with customizable list rows.InputsAvatarImage, initials or icon for a person, with status dot and badge.Data displayBadgeTinted pill for status text, counts and dots, optionally pinned to a corner of another element.Data displayBannerA persistent, full-width message in the page flow for system notices, outages and account status.FeedbackBar chartBars over categories or time buckets, with several series drawn side by side within each band.ChartBar ListA ranked list whose rows carry their own bar: top pages, referrers, countries, or the changes between two periods.Data displayBorder BeamA decorative beam that travels around the border of any positioned container.LayoutBottom NavThe mobile tab bar: three to five destinations along the bottom of the screen, each an icon over a short label with a count or dot badge.NavigationBreadcrumbNavigation trail of link buttons with separators, a current page and optional collapsing.NavigationBubble chartAn ECharts scatter plot with a third measure encoded as bubble area, for comparing how two measures relate while showing how much each point weighs.ChartButterfly chartTwo series back to back on a shared category axis, the categories named between them. The population pyramid is the classic case.ChartButtonThemeable button with slots for text, prefix, suffix and running icons.ButtonsButton GroupJoined actions and polished segmented controls with single or multiple selection.ButtonsCandlestick chartAn ECharts OHLC chart for market sessions and other open-close ranges, with semantic positive and negative colours.ChartCardGroups related content and actions on a single bordered surface.LayoutCard InputCard number, expiry date and security code in one field, formatted as the brand prints them and checked as they are typed.InputsCarouselA swipeable slideshow with previous/next controls, indicators, looping and optional autoplay.LayoutCascaderSelect a value from related, multi-level data in one floating panel.InputsChat InputAuto-growing message composer with keyboard submission, toolbar actions and native form support.ChatChat MessageFlexible message row for conversations, assistant answers and activity updates.ChatChat Message ListScrolling conversation log that follows new messages, counts unread ones and loads older history.ChatCheckboxNative checkbox behaviour in a quiet, themeable box with an opt-in hover layer.InputsCheckbox groupCheckboxes grouped into one form control with a value array, a group label and an at-least-one rule.InputsChipA compact pill for a filter, a choice or an entered value: selectable as a toggle, removable with a button or the keyboard.InputsChip GroupA single row of chips or badges that collapses whatever does not fit into a +N indicator, recomputed as the row or its items change size.Data displayChoice MatrixRows × columns of checkboxes or radio buttons in one form control: permissions, notification settings, agreement scales.InputsChord chartFlows between groups around a circle, where one row is one flow from a source to a target.ChartCitationA numbered inline marker that names its source, with a hover preview of the page it cites.ChatCode EditorEditable, syntax-highlighted source field on CodeMirror 6, themed entirely through CSS variables.Editors & viewersCode ViewerSyntax-highlighted code with line numbers, copy button and dark mode, powered by shiki.Editors & viewersColor AreaTwo-dimensional area for picking saturation and value of a colour.InputsColor SelectColour swatch that opens a full picker built from area and slider.InputsColor SliderHorizontal slider for choosing a hue from 0 to 360.InputsCommandA searchable list of commands: type to filter, arrows to highlight, Enter to run. The core of a ⌘K palette.NavigationComparison BarSegmented ratio bar comparing two or three quantities, such as the bid/ask balance of an order book.Data displayConfirm DialogAsks the user to confirm an action: await show() or confirm() for a true/false answer, with a destructive variant and an async confirm action.FeedbackContext MenuA menu opened by right-clicking or long-pressing an area, built from a slotted c2-menu or a render function per clicked spot.NavigationCopy ButtonButton that copies text to the clipboard — the element it sits in, another element by id, or a literal string.ButtonsCountdownTime left until a date, or through a timer, drawn as segments, a clock or a phrase, and kept current to the second.Data displayDashboardGrid of resizable panes, dragged by the edges they share.LayoutDate InputForm-associated single-date input with native picker, constraints, helper text and error states.InputsDate SelectorAccessible one- or two-month calendar for choosing a date range.InputsDate StripA row of days to pick one from, a week at a time, with dots on the days that have something on them.InputsDate Time PickerForm-associated date-and-time field with a calendar and time popup, min/max/step constraints and an IANA time zone.InputsDepth chartCumulative bid and ask size around the mid price of an order book, as trading screens show market depth.ChartDescription ListRead-only label and value pairs for a detail page, in columns that wrap with the available width.Data displayDetailsCollapsible disclosure built on native details and summary.LayoutDiff ViewerRead-only line diff of two texts, unified or side by side, with folded unchanged lines and word highlights.Editors & viewersDistribution BarOne 100% stacked bar of a breakdown, with a legend of shares and the hovered part brought forward.Data displayEmoji PickerA searchable grid of emoji in categories, with skin tones and the emoji used last.InputsFacet ListOne facet of a filter sidebar: an attribute’s values with counts, to include or exclude from a search.InputsFieldsetGroups related controls under a legend, with a description, a group-level error and a disabled state that reaches every control inside.InputsFilter BuilderA filter bar of sentence chips (Status is any of Active), an add-filter picker and an editor for each part; it reports a plain JSON filter tree.InputsFloat ButtonA floating action button for the main action of a screen, which can expand into a speed dial of related actions.ButtonsFlowA pipeline, dependency graph or database schema on a pannable canvas: steps with a status, smooth edges, rows joined row to row, auto layout, draggable nodes saved to localStorage, a hover card and a context menu.Editors & viewersFormForm container with validation timing, an error summary, server errors, dirty tracking and async submit.InputsForm FieldLabel, hint, error, warning and character counter around any form control, wired for assistive technology.InputsFormat DateA date and time formatted for the reader's language and, optionally, a fixed time zone.Data displayFormat NumberA number formatted for its locale: currency, percent, units, compact counts and byte sizes, from Intl.NumberFormat.Data displayGanttA read-only project timeline: tasks, groups, milestones and dependencies on a day, week or month scale.PlanningGauge chartA focused radial KPI gauge drawn by ECharts, with a configurable scale, progress arc and pointer.ChartGoogle MapGoogle Maps with markers, a road route from A to B, and Street View, loaded once per page from a browser key.Data displayHeaderArranges brand, navigation, actions and a mobile trigger in a reusable site shell.LayoutHeatmap chartRows binned into cells by two keys, aggregated, and coloured by a sequential, diverging or stepped scale: a currency matrix, pair × tenor, hour × weekday, or a calendar of days. Drawn by ECharts, with a colour key that counts, marks and filters.ChartHighlightMarks the parts of a text that match a search query.Data displayHover CardInteractive preview card shown when a link or mention is hovered or focused, rendered in the top layer.FeedbackIcon ButtonRound, hoverable button wrapping a slotted SVG icon.ButtonsImageImage with lazy loading, a loading placeholder, an error fallback, click-to-load for untrusted URLs and a full-screen preview.Data displayImage CropperChoose the part of an image to keep by moving and resizing a selection, then read it back as a canvas or a blob.Editors & viewersIndicatorSolid dot or count pinned to an edge or corner of any element, with an accessible name for the count.Data displayInline EditText that turns into a field on click: Enter (Ctrl/⌘+Enter when multiline) commits, Escape cancels, and any control with a value that fires change can be the editor.InputsJSON FormA form generated from a JSON Schema, laid out by the schema, a UI schema or your own markup.InputsJSON ViewerBrowse a JSON value as a collapsible tree, search it, and copy any path or value.Editors & viewersKanbanBoard layout and card movement by pointer or keyboard, with cards drawn by your own renderItem.PlanningKbdKeyboard key label for shortcuts and command hints, with the semantics of the native kbd element.Data displayKey Value EditorEditable KEY=value rows for environment variables and headers: paste a .env file to split it into rows, mask secret values, and flag duplicate or malformed keys.InputsLabelCaption that names and activates the control referenced by its for attribute, with a required marker.InputsLine chartA line chart over a time or numeric x axis, drawn on canvas by uPlot, with series declared as children.ChartLink ButtonText-styled control for link and navigation actions, rendered as a real anchor or a button.NavigationListVertical list container with single or multiple selection.Data displayList ItemSelectable row with icon slots, used on its own or as the option of list and select.Data displayLoading OverlayCovers a region while it loads: the content stays in place, dimmed and blocked, with a spinner and an announced label.FeedbackLog ViewerExplore large logs with variable-height virtual scrolling and sticky tabular attributes.Editors & viewersMap chartA choropleth and point map on vector outlines, drawn by ECharts: regions shaded by a value, with layers of sized points and flow lines, on the bundled world and US maps or your own GeoJSON, TopoJSON or SVG.ChartMarkdownSafe markdown renderer that streams: chat answers and READMEs, with code, math and diagrams.ChatMarkerAn inline marker that highlights, underlines, strikes through, boxes or circles a run of text.Data displayMask InputA text input that fits what is typed to a pattern, for postcodes, IBANs, tax IDs, expiry dates and other fixed formats.InputsMasonryAutomatically pack differently sized dashboard tiles, then move or resize them in edit mode.LayoutMaster DetailA list beside the record it opens, one pane at a time with a Back step when the element is narrow.LayoutMathTeX formulas rendered as native MathML: no font CSS, readable by screen readers, safe for untrusted input.Data displayMenuCommands, links, checkboxes and submenus in a popover anchored to a trigger.NavigationMenubarDesktop-style File, Edit and View menus in one bar, with the arrow-key and hover movement of an application menu bar.NavigationMermaidMermaid text diagrams drawn in your theme colours, loaded on demand and safe for untrusted sources.Data displayMeterA measurement inside a known range — storage, quota, strength — with native meter thresholds and an optional segmented breakdown.Data displayModalDialog built on the native dialog element: focus trap, backdrop, Escape, title, body and footer.FeedbackMoney InputCurrency amount field that groups digits as you type, follows the locale and stores an integer count of minor units.InputsMonth PickerPick a month, or a year: billing periods, reports and card expiry.InputsMonth PlannerMonth calendar that draws events and trips as bars across the days they cover.PlanningNavigation MenuSite navigation bar whose triggers open panels of links below the header.NavigationNotepadA rich-text notepad that looks like paper: handwriting on ruled lines, a formatting toolbar over the selection, checklists and tear-off pages.PlanningNotification CenterAn inbox panel of notifications grouped by day, with read and unread states and mark all as read.FeedbackNumber InputForm-associated numeric input with native validation, step controls, adornments and helper states.InputsOrg ChartA hierarchy drawn as connected cards that collapse and expand: an organization chart, a reporting line or a team structure.Data displayOTP InputForm-associated one-time-code field with one cell per character, paste and SMS autofill, grouping and masking.InputsOverflow ListOne row of actions or links that shows what fits and folds the rest into a "More" menu, refitting as its width changes.LayoutOverlap chartA Venn diagram of two or three sets, where each circle is a set and each shared area counts the members of exactly that combination.ChartOverlayAnchored popup built on the browser Popover API, positioned with floating-ui.FeedbackPage EditorA Notion-style editor for long text: Markdown shortcuts while you type, a / menu for blocks, a toolbar over selected text, code blocks with syntax colours and eight named colours.Editors & viewersPage HeaderThe top of a page: breadcrumb or parent link, your heading with status badges, description, metadata, page actions that fold into a menu, tabs and a toolbar.LayoutPaginationPage navigation in three layouts: numbered pages, a simple page status, or a table-footer row with rows-per-page.NavigationPassword FieldA password input with a show/hide toggle, a strength meter, a requirements checklist and a Caps Lock warning.InputsPhone InputA phone number field with a searchable country picker, as-you-type grouping and an E.164 value.InputsPie chartA pie or donut chart drawn by ECharts, where one row is one slice and label-field names it.ChartPopconfirmA small "Are you sure?" popup anchored to the button that asked for it.FeedbackProgressProgress bar or ring, indeterminate or filling to a value, with an optional label and count.FeedbackPyramid chartRanked levels of a whole, stacked from a narrow apex to a wide base, where one row is one level.ChartQR CodeGenerate accessible, themeable QR codes locally as crisp SVG graphics.Data displayQuery InputA key:value query field whose filters are chips you can switch off or remove, with syntax highlighting and field and value suggestions, as in Datadog, GitHub and Sentry.InputsQuestionnaireA multi-step single- and multiple-choice flow with validation, shortcuts and form submission.InputsRadar chartCompare several profiles across the same set of normalized indicators.ChartRadioRadio options built on native inputs, grouped into one value with keyboard navigation.InputsRateAccessible star rating input with hover preview, keyboard control and optional half values.InputsReaction BarEmoji reactions with counts under a message or comment, toggled by the current user, with a picker to add more.ChatRelative TimeTime relative to now, such as "3 minutes ago" or "in 2 days", that keeps itself current and shows the full date on hover.Data displayReorder ListReorder a vertical queue with pointer or keyboard input while the application owns persistence.Data displayRich Text EditorA compact formatted-text field for comments, replies and email bodies: bold, links, lists, quotes and code, a one-tab-stop toolbar, and a Markdown value.InputsSankey chartQuantities moving through stages, where one row is one flow and each band is as wide as what it carries.ChartSave BarA floating bar that appears while a form has unsaved changes, with Discard and Save.LayoutScatter chartAn ECharts scatter plot for finding relationships, clusters and outliers across two numeric measures.ChartSearch FieldA search box with a debounced search event, a clear button, a keyboard shortcut hint and recent searches.InputsSecret FieldShows an API key or other secret masked, with buttons to reveal it, copy it and ask for a new one.InputsSelectDropdown that pairs a themeable trigger with an anchored list of c2-list-item options.InputsSeparatorHorizontal or vertical rule with an optional label, for dividing content and toolbars.LayoutSheetDialog pinned to an edge of the screen, for content that complements the page rather than interrupting it.FeedbackShortcutKeyboard shortcuts for a whole application from one element: each binding fires an action event, runs a handler or activates a target.InputsSide NavResponsive navigation drawer beside the page: pushes the content on large screens, slides over it with a backdrop on small ones.NavigationSkeletonPlaceholder block standing in for content that has not arrived, in three shapes and three animations.FeedbackSkip LinkA "Skip to main content" link that appears when a keyboard user tabs onto it and moves focus into the main content.NavigationSliderRange input with a themeable track, thumb, step ticks and value bubble.InputsSparklineA chromeless trend line sized for a table cell, a list row or the trend slot of a c2-stat.ChartSpinnerCircular progress indicator, indeterminate or showing a value, with optional text.FeedbackSplit ButtonA main action with a caret menu of alternatives, such as "Send ▾", or a remembered choice like a merge method.ButtonsSplit PanelTwo panels separated by a divider the user drags, or moves with the keyboard, to resize them.LayoutSpreadsheetA small editable grid with basic formulas, for budgets, quotes, price lists and score sheets.Editors & viewersStatDisplays a KPI with an optional icon, trend and supporting description.Data displayState TimelineOne band per series, coloured by the discrete state it was in over time: service health, CI runs, host power.ChartStatus LightColoured dot plus a short label for the state of something, such as Live, Building or Failed.Data displayStatus PanelCommunicate empty states, operation outcomes and recoverable errors with clear next steps.FeedbackStepsThe trace of a task as it runs, or a stepper across the top of a view: statuses, durations, stages that open while they work, and steps the reader can select.Data displayStickyPins content to the top or bottom of its scroll container and tells you when it is stuck, optionally hiding it while the reader scrolls down.LayoutStreaming TextPlain text that arrives in bursts, such as an LLM answer, revealed at a steady pace behind a caret.ChatSwipe ActionA list row that slides sideways to reveal actions behind it, as in a mail or task list on a phone.LayoutSwitchOn/off toggle on a native switch input, with label, description and thumb icons.InputsTableVirtualized data grid with declarative columns, sorting, selection, pinning and resizing.Data displayTable Of ContentsAn "On this page" navigation that lists the headings of a document, nests them by level and highlights the section being read.NavigationTabsTab strip that shows one content panel at a time.NavigationTag InputTurns typed or pasted text into removable tags — recipients, keywords, labels — with configurable delimiters, parsing and validation.InputsText FieldSingle-line input with icon slots, clear button, helper and error text, and a character counter.InputsTextareaMultiline text input with resizing, helper and error text, and a character counter.InputsTheme SelectColour-theme switcher: click to step to the next mode, hover for the full menu.InputsTime InputForm-associated time-of-day input with a scroll-wheel picker, step and range constraints, helper text and error states.InputsTime Range PickerDashboard time range control: searchable quick ranges, an absolute range typed or picked on a calendar, time zone, shift and zoom, and auto-refresh.InputsTime Slot PickerPick a free time from someone's calendar: a row of days, then that day's times grouped into morning, afternoon and evening.InputsTimelineA vertical sequence of dated events on a connected rail: order history, activity feeds, changelogs.Data displayToastNotification cards and a manager for stacked, queued notifications with independent lifetimes.FeedbackTodo ListA to-do list with the feel of paper: hand-drawn ticks, notes, highlighters, swipe and drag, and a remembered look.PlanningToggletipA small ⓘ button that opens a help bubble on click or tap; the bubble can hold links and is announced to screen readers.FeedbackTooltipContextual hint shown when its target is hovered or focused, rendered in the top layer.FeedbackTourA guided product tour that spotlights one element at a time and explains it in a panel beside it.FeedbackTrace WaterfallShow the spans of a distributed trace as a tree, each with a duration bar on one shared time axis.Data displayTreeHierarchical tree view with expansion, selection, checkboxes and lazy loading.Data displayTree SelectA dropdown for picking one or several rows from a hierarchy, with checkboxes, search and a form value.InputsTreemap chartA whole split into nested rectangles, each sized by its value: market maps, budgets and disk usage.ChartTruncateClamps text to a number of lines, with an optional Show more button.Data displayUploadDrag-and-drop file selection with validation, upload progress, retry, cancellation, and attachment results.InputsView OptionsThe Display popover of a collection: layout, grouping, ordering on several levels, Show switches and visible properties, reported as one plain value.InputsVirtual ListWindowed list with built-in search, sorting, selection and an async data source.Data displayVisually HiddenText for screen readers only: kept in the accessibility tree, drawn nowhere, optionally shown while it holds focus.LayoutWaterfall chartA running total bridged by the steps that move it, where one row is one step and totals mark where the bridge lands.ChartWeek PlannerWeekly schedule with time blocks: a typical week with optional odd and even weeks, or a dated week the user edits.PlanningWorking IndicatorA live "work in progress" line: animated mark, shimmering label, trailing dots and elapsed time.FeedbackFeather Icons287 open-source Feather icons, one web component each.IconsMat Icon2,234 Material Icons ligatures rendered through a single element.IconsPhosphor Icons1,512 flexible icons in six weights, one web component each.IconsSymbols157 themeable spot illustrations for empty states, status panels, onboarding and error pages.IconsTask icons191 duotone icons for to-do items: work, home, health, sport, learning, food, money, travel and more.IconsThemingTheme every c2n component from a handful of design tokens with @c2n/theme, or reach for any component variable directly.GuideLanguagesComponents show their text in English; add your app’s languages as one JSON object, picked by the nearest lang.GuideFrameworksUse the components from React, Vue, Angular, Svelte, Lit or plain HTML — typed events, generated template types, and the one piece of configuration each framework needs.GuideUsing c2n in an applicationThe workflow behind every c2n app: load the theme once, use c2-* tags directly, and turn every repeated pattern into a small variant or composed component.GuideAI toolsGive Claude Code, Codex, Google Antigravity or GitHub Copilot the c2n skill, live component APIs, examples and application conventions.GuideNo components match.