Skip to content

Theming and CSS variables ​

All components share one stylesheet, @eightkk/vue-weave/style.css. Colours, sizes and fonts are --vw-* CSS custom properties that you set on the component or any ancestor; the opt-in vw-theme-dark class switches to the built-in dark theme and vw-theme-auto follows prefers-color-scheme. Forced colours, reduced motion and print styles are included. Slots replace the drawing of nodes, bars, cards and events when properties are not enough, and dir="rtl" mirrors the layout for right-to-left languages.

vue
<template>
  <div class="vw-theme-auto plan-view">
    <GanttChart :rows="rows" :bars="bars" :range="range" />
  </div>
</template>

<style>
.plan-view {
  --vw-accent: #0b7a75;
  --vw-surface: #fbfdfc;
}
</style>

The documented --vw-* properties and the classes you add yourself (vw-theme-dark, vw-theme-auto) are part of the compatibility promise; the vw- classes the components emit are not. Every example on this site follows the site's light and dark mode with these classes.

Custom content ​

The graph node slot receives its node, measured layout box, the camera scale and its selected, related, highlighted and dimmed states. It is inside a translated, keyboard-accessible SVG group. Render SVG children in local coordinates. The stylesheet paints node rect and text elements, including those in a slot, and elements with the class vw-node-shape (the outline of the default diamond, ellipse and hexagon nodes), and CSS wins over presentation attributes such as fill; add unstyled-node-slots so the slot's own attributes and classes decide the paint.

vue
<NetworkGraph :nodes="nodes" :edges="edges" unstyled-node-slots>
  <template #node="{ node, box, selected }">
    <rect :width="box.width" :height="box.height" :rx="8"
      :fill="selected ? '#d8e9fb' : '#fff'" stroke="#365772" />
    <text x="12" y="30">{{ node.label }}</text>
  </template>
</NetworkGraph>

Return a custom GraphLayout to use stored node positions or another layout algorithm. The layout callback is pure. It returns boxes, paths and label positions in the same world coordinate space.

Gantt row/bar/tick slots accept ordinary HTML. The bar slot is already inside a focusable button, so avoid nested buttons or links. Use the select event to open a detail panel elsewhere.

Themes and localization ​

Styles use the vw- class prefix. Set CSS variables on an ancestor to change themes. Examples include --vw-surface, --vw-surface-muted, --vw-surface-hover, --vw-text, --vw-muted, --vw-border, --vw-grid, --vw-edge, --vw-accent and --vw-on-solid. Unset, every component uses the same defaults: --vw-surface #fff, --vw-text #172c3b, --vw-muted #4c6371, --vw-accent #245e96, --vw-on-solid #fff and, for hovered buttons and items, --vw-surface-hover #edf5fa; --vw-surface-muted, --vw-border and --vw-grid default to slightly different light shades by part (for example lighter row lines than outer borders).

Tone-specific variables follow --vw-blue-ink, --vw-blue-line, --vw-blue-pale and --vw-blue-solid. The same suffixes are available for teal, amber and violet. --vw-baseline, --vw-marker and --vw-dependency-highlight control baseline bars, time markers and highlighted dependency paths. When two or three baseline sets are drawn (baselineIds), --vw-baseline colours the first slot and --vw-baseline-2 (default #9a4c95) and --vw-baseline-3 (default #23806f) the second and third; the built-in dark theme sets them to #dc9fd6 and #6fd0bc. To colour a set by its ID instead of its slot, style .vw-gantt-baseline[data-vw-baseline="rev1"]. The demo's own .dark class uses this contract too. --vw-dimmed-opacity (default 0.28) sets the opacity of graph nodes and edges de-emphasized through matchIds or dimmedIds.

--vw-edge-selected (default --vw-accent) colours the edges selected through edgesSelectable; the NetworkGraph tooltip uses --vw-surface, --vw-border and --vw-text.

--vw-graph-highlight (unset by default, falling back to --vw-dependency-highlight, #a74f08, and to its dark value in the dark themes) colours the display-only highlights of NetworkGraph: the outline of nodes in highlightedNodeIds (.vw-network-node.vw-is-highlighted) and the edges in highlightedEdgeIds (an edge group with vw-is-highlighted). The graph export methods read it as the highlight colour (highlightColor of renderGraphSvg). In forced-colors mode highlighted nodes get a dashed Highlight outline and highlighted edges a dashed CanvasText stroke.

Node shapes and edge decorations (NetworkNode.shape, GraphEdge.markerStart, markerEnd and animated) reuse the node and edge colours: the outline of a diamond, ellipse or hexagon node (.vw-node-shape) is painted like the node rectangle, markers take the colour of their edge, and the hollow circle and diamond markers (.vw-edge-marker-hollow) are filled with --vw-surface-muted, so they match the stage in the light and dark themes. Animated edges (.vw-network-edge.vw-is-animated) add one variable:

VariableDefaultUsed for
--vw-edge-animation-duration1sTime the dash pattern of an animated edge takes to move two dashes (20 chart units) towards the target

NetworkGraph editing aids add two variables, used only when the matching prop is set:

VariableDefaultUsed for
--vw-background-pattern--vw-grid (#c7d6df)Dots or lines of the background pattern
--vw-guide#c2255cDashed alignment guides (vw-guide) drawn with alignmentGuides

NetworkGraph port rules (connectionRules) mark the connection handles while a connection or reconnection is in progress: a valid target (.vw-connect-handle.vw-is-valid-target) is drawn larger and filled, and an invalid one (.vw-connect-handle.vw-is-invalid-target) hollow with a dashed outline and faded, so the two differ without colour. In forced-colors mode valid targets are filled with Highlight and invalid ones outlined in GrayText. The rules add two variables, with values in the built-in dark themes:

VariableDefaultUsed for
--vw-connect-valid#1d7a4f (dark #6fd0a0)Fill of connection handles that are valid targets
--vw-connect-invalid#a8361f (dark #ff8a80)Dashed outline of connection handles that are not valid targets

The opt-in label editor, lasso and toolbar slots of NetworkGraph use the theme colours: the lasso outline (vw-lasso-selection) is drawn in --vw-accent, and the label editor (vw-label-editor) and the toolbar containers (vw-node-toolbar, vw-edge-toolbar) use --vw-surface, --vw-border, --vw-text and, for the editor's border, --vw-accent. They add two length variables:

VariableDefaultUsed for
--vw-label-editor-width140pxWidth of the label editor of an edge (vw-label-editor.vw-is-edge); a node's editor takes the node's on-screen width, at least 120 pixels
--vw-toolbar-offset8pxGap between a node or edge and the container of the node-toolbar or edge-toolbar slot

The opt-in swimlanes of NetworkGraph (lanes) add five variables; their defaults follow the theme variables, so the built-in dark theme applies to them. Each lane is a vw-swimlane group (every second one also vw-is-alternate) with a vw-swimlane-band, a vw-swimlane-header and the title in vw-swimlane-title; the minimap draws vw-minimap-lane outlines.

VariableDefaultUsed for
--vw-lane-fill--vw-surface (#ffffff)Fill of a lane band
--vw-lane-fill-alternate--vw-surface-muted (#f1f5f8)Fill of every second lane band (vw-is-alternate)
--vw-lane-header-fill--vw-surface-hover (#e4ecf2)Fill of a lane header
--vw-lane-border--vw-border (#c9d6df)Outline of bands and headers, and the minimap lane outlines
--vw-lane-title--vw-text (#172c3b)Lane title text

The opt-in quantity bands of NetworkGraph (edgeBands) stroke each band's edge path (vw-network-edge vw-network-band) in --vw-edge with the band width, and reference (loop) bands (vw-is-reference) with a dash pattern, so they differ without colour. The default pattern is 10 6, lengthened for wide bands (dash twice and gap at least three quarters of the band width) so a wide loop band reads as dashed rather than as a comb of stripes; along a straight-segment loop route the gaps are evened out so the band starts and ends with a dash at its nodes. Selected bands take --vw-edge-selected and highlighted ones --vw-graph-highlight; the hit area of a band (vw-edge-hit vw-is-band) is as wide as the band. In forced-colors mode bands are drawn in CanvasText, reference bands in GrayText with their dashes and selected bands in Highlight. Four variables:

VariableDefaultUsed for
--vw-flow-band-opacity.5Opacity of a band, so crossing bands stay readable
--vw-flow-band-active-opacity.78Opacity of a hovered, selected or highlighted band
--vw-flow-reference-opacity.35Opacity of a reference (loop) band
--vw-flow-reference-dash10 6, scaled with the band widthDash pattern of a reference band; setting it uses one pattern for every width. NetworkGraph writes the width-scaled default to an internal inline --vw-band-dash on each reference band; do not set that one yourself

The opt-in TaskBoard component (vw-board) reuses the theme variables (--vw-surface, --vw-surface-muted, --vw-border, --vw-text, --vw-muted, --vw-accent and the tone families through vw-tone-* on each card), so the built-in dark theme and your own theme apply to it. It adds these variables; the built-in dark themes set --vw-board-wip-warning to #ff8a80 and --vw-board-drop to #82badf. The board lays its columns out in a CSS grid with logical properties, so dir="rtl" (or an inherited right-to-left direction) places the first column on the right without extra rules. In forced-colors mode cards are outlined in CanvasText, the selection and focus in Highlight, and the drop indicator is Highlight (dashed CanvasText when the drop would exceed a WIP limit). A column under its minimum gets a dashed header rule and count badge there, and a collapsed column strip a dashed GrayText border. In print the board grows to its content and hides the collapse toggles.

VariableDefaultUsed for
--vw-board-column-width232px (196px below 700 px)Minimum width of a column; columns share any extra width
--vw-board-cell-min-height64pxMinimum height of a cell, so an empty cell stays a drop target
--vw-board-wip-warning#a8361f (dark #ff8a80)Over-limit warning text, the count badge of a column at or over its limit and the tint of its cells
--vw-board-wip-under#8a5a00 (dark #f0c060)Under-minimum warning text, the count badge and the header rule of a column below its wipMin
--vw-board-collapsed-width44pxWidth of a collapsed column strip
--vw-board-collapsed-fillborder colour at 35%Fill of the cells below a collapsed column
--vw-board-drop--vw-accent (#245e96, dark #82badf)Drop indicator, outline of the target cell and of a picked-up card

The opt-in TreeGrid component (vw-tree-grid) reuses the theme variables (--vw-surface, --vw-surface-muted, --vw-surface-hover, --vw-border, --vw-grid, --vw-text, --vw-muted, --vw-accent, --vw-on-solid and the tone families through vw-tone-* on cells with a tone), so the built-in dark themes and your own theme apply to it. Rows and cells are positioned with logical properties, so dir="rtl" puts the tree column on the right without extra rules. Its classes start with vw-tree-grid- (vw-tree-grid-row, vw-tree-grid-header-cell, vw-tree-grid-cell, vw-tree-grid-editor, vw-tree-grid-fill-handle, vw-tree-grid-drop), with the shared modifiers vw-is-selected, vw-is-highlighted, vw-is-active, vw-is-editing, vw-is-in-range, vw-is-status (a status line) and vw-is-<state> on cells without a value (vw-is-none, vw-is-unknown, vw-is-not-applicable, vw-is-loading, ...). In forced-colors mode the focus and range use Highlight, selected rows Highlight with HighlightText, and highlights a dashed CanvasText outline. In print the scroller grows to its content, but only the rendered window of lines and columns is in the DOM; use exportSvg or exportPng (or renderTreeGridSvg) for complete output. It adds these variables; the built-in dark themes set --vw-tree-grid-highlight to #f0a060, --vw-tree-grid-selected to #243e58 and --vw-tree-grid-error to #ff8a80.

VariableDefaultUsed for
--vw-tree-grid-indent16pxIndent per tree level in the row headers
--vw-tree-grid-header--vw-surface-muted (#f3f7fa)Background of the header row
--vw-tree-grid-line--vw-grid (#e8eef2)Row and cell rules
--vw-tree-grid-selected#e3eefa (dark #243e58)Background of the rows in selectedRowIds
--vw-tree-grid-highlight--vw-dependency-highlight (#a74f08, dark #f0a060)Bar and label of highlighted rows and the outline of highlighted cells
--vw-tree-grid-error#a8361f (dark #ff8a80)Editor error messages, the border of an invalid editor and the mark of a failed cell
--vw-tree-grid-drop--vw-accentDrop indicator and outline of a row drag

The component also sets --vw-tree-grid-row-height, --vw-tree-grid-header-height, --vw-tree-grid-tree-width (from its props) and --vw-tree-grid-level (on each row header) inline; they are internal, set the props instead.

With the group slot, the stylesheet does not paint the slot content (the group gets vw-has-slot), and the transparent move handle (vw-group-handle) shows an --vw-accent outline while focused. The minimap-node slot content sits in a vw-minimap-custom group, which the minimap's rectangle fill does not reach.

GanttChart editing and load overlays add --vw-now (now marker), --vw-load (load within capacity), --vw-load-overload (load above capacity) and --vw-load-capacity (dashed capacity line). Dependency lag labels (vw-gantt-lag) use --vw-text on a --vw-surface halo, or --vw-dependency-highlight for highlighted dependencies. Link handles, the dependency selection outline and the connection preview use --vw-accent; zoom preset buttons use --vw-accent and --vw-on-solid for the active preset.

Linked views and typed cells add five variables, used only when the matching prop is set:

VariableDefaultUsed for
--vw-bar-highlight--vw-dependency-highlight (#a74f08)Outline of bars in highlightedBarIds (.vw-gantt-bar.vw-is-highlighted)
--vw-load-focus--vw-accent (#245e96)Focus outline of load segments with loadSelectable
--vw-load-highlight--vw-dependency-highlight (#a74f08)Inset ring of load segments matched by highlightedLoadTargets (.vw-gantt-load-segment.vw-is-highlighted)
--vw-load-selected--vw-accent (#245e96)Thicker inset ring of load segments matched by selectedLoadTargets (.vw-gantt-load-segment.vw-is-selected)
--vw-field-invalid#c4161cBorder of a built-in field input whose text could not be read (aria-invalid)

In forced-colors mode highlighted bars get a dashed CanvasText outline, focused load segments a Highlight outline, highlighted load segments a dashed CanvasText outline and selected load segments a solid Highlight outline.

Scheduling overlays add four variables, used only when the matching input is set:

VariableDefaultUsed for
--vw-non-working#eaeff3nonWorkingPeriods shading behind the grid
--vw-critical#b42318Outline of bars with critical: true
--vw-float#5b7083Float line from a bar's end to its latestEnd
--vw-deadline#a74f08Deadline indicator and the dashed outline of a late bar

Segmented bars draw their work pieces and gap connectors with the bar's tone variables.

The opt-in progress slider (progressEditable) is drawn in --vw-accent, and the tooltip slot container (vw-gantt-tooltip) uses --vw-surface, --vw-text and --vw-border; they add no variables. Restyle the tooltip through its class or your slot content.

Drag to create (creatable) draws its preview (vw-gantt-create-preview) with --vw-accent and the row add button (vw-gantt-create-button) with --vw-surface, --vw-border and --vw-accent. The cascade preview of the cascade prop adds one variable:

VariableDefaultUsed for
--vw-cascade#6d4bb3Dashed outline and light fill of the bars a cascade callback moves during a drag (vw-gantt-cascade-preview)

Row hierarchy moves (rowsReorderable) draw the move handles (vw-row-move-handle) with --vw-muted and --vw-surface-hover and the drop indicator (vw-gantt-row-drop) with --vw-accent. The status date adds one variable:

VariableDefaultUsed for
--vw-status#1f7a4dThe statusDate line and its label (vw-gantt-status-date) and the progress line of showProgressLine (vw-gantt-progress-line); the status export theme colour

Scheduling constraints (TimelineBar.constraints) add two variables. Their markers and, with constraintsEditable, their handles have the class vw-gantt-constraint with the modifiers vw-is-start or vw-is-finish (flag at the top or the bottom), vw-is-lower, vw-is-upper or vw-is-fixed (the glyph) and the states vw-is-violated and vw-is-dragging. The component sets --vw-constraint-reach on each, the length of its stem across the lane, for the stylesheet. A focused handle uses the --vw-accent focus outline.

VariableDefaultUsed for
--vw-constraint#a1246eConstraint markers and handles (vw-gantt-constraint); the constraint export theme colour
--vw-constraint-violated#c4161cA constraint that the bar's dates break (vw-gantt-constraint.vw-is-violated, drawn with a dashed stem); the constraintViolated export theme colour

Marker ranges (markerRanges) add four variables. A range draws a band (vw-gantt-range, with vw-is-row when it covers single rows) under the bars and a label strip at the bottom of the time header (vw-gantt-range-label). A range with a tone adds vw-tone-<tone> vw-has-tone to both and uses that tone's --vw-<tone>-pale, -line and -ink instead of the first three variables.

VariableDefaultUsed for
--vw-range#f9efdcFill of the band and the label strip of a range without a tone; the range export theme colour
--vw-range-line#b58848Top edge of the label strip; the rangeLine export theme colour
--vw-range-ink#764908Label text; the rangeInk export theme colour
--vw-range-opacity0.7Opacity of the band, so grid lines and non-working shading stay visible through it (the export uses 0.7)

Column resizing (columnsResizable) draws its separators (vw-column-resize) with --vw-border, and with --vw-accent while hovered, dragged or focused; it adds no variable. The width of the row label column is the existing --vw-row-label-width (default 154px, 106px on narrow screens); the labelWidth prop sets it on the chart canvas.

GanttChart also sets layout variables on its canvas element (vw-gantt-canvas) for its own stylesheet. A host stylesheet can read them, for example to place an overlay on the timeline, but setting them on an ancestor has no effect because the component sets them itself:

VariableValueMeaning
--vw-label-area-widthlengthWidth of the row label area: --vw-row-label-width plus the width of any extra columns, including a column resize in progress. Time-axis content starts this far from the inline start edge
--vw-axis-widthpixelsWidth of the time axis
--vw-header-heightpixelsHeight of the header, including headerBands
--vw-row-depthnumberSet on each row label: its hierarchy depth, capped at 5. The stylesheet uses it for indentation
--vw-grid-steppixelsWidth of one tick step. Kept for custom stylesheets; the built-in styles no longer use it

--vw-item-ink, --vw-item-line, --vw-item-pale and --vw-item-solid are internal. The vw-tone-* classes set them from the tone families above, and nodes, bars and segments read them. They are not a theming API: change the tone variables (for example --vw-blue-solid) instead.

EventCalendar uses the shared theme variables (--vw-surface, --vw-surface-muted, --vw-surface-hover, --vw-text, --vw-muted, --vw-border, --vw-grid, --vw-accent, --vw-on-solid and --vw-now) and the tone families for event backgrounds, so the built-in dark themes apply to it unchanged. Its classes start with vw-calendar- (for example vw-calendar-event, vw-calendar-column, vw-calendar-month-day, vw-calendar-preview and vw-calendar-now), with the shared vw-is-* modifiers (vw-is-selected, vw-is-editable, vw-is-dragging, vw-is-today, vw-is-outside for days of another month) and vw-continues-before and vw-continues-after on events cut by a day or week boundary. Positions use logical properties, so dir="rtl" mirrors it without extra rules. It adds three variables:

VariableDefaultUsed for
--vw-calendar-gutter56px (42px below 700 px wide)Width of the hour labels and the corner of the all-day row
--vw-calendar-today--vw-surface-hoverBackground of today's column and month day (with the now prop)
--vw-calendar-event-accentthe tone's --vw-item-solidAccent stripe at the inline start of an event; CalendarEvent.color sets it per event

Class names ​

Every class that the components emit and the stylesheet targets starts with vw-, so generic utility classes in the host page (for example Tailwind's outline or Bootstrap's active) cannot restyle chart elements. Element classes are named after the element (vw-gantt-bar, vw-network-node). State and variant modifiers use the vw-is-* form and are always combined with an element class, for example .vw-gantt-bar.vw-is-selected or .vw-network-edge.vw-is-related. Classes you add yourself, such as a class attribute on the component or the content of a slot, are passed through unchanged.

The emitted classes and the DOM they sit on describe the current markup. Unlike the documented --vw-* properties and the theme classes you add, they are not covered by the compatibility promise and can change in a minor release, with a changelog note. Prefer --vw-* properties and slots for lasting customization.

In 0.1.0 these modifiers had no prefix; 0.2.0 adds it. When you upgrade from 0.1.0, rename them in custom stylesheets, test selectors and DOM queries:

Old classNew classApplied to
selectedvw-is-selectedSelected graph nodes, minimap nodes, selected edge hit areas, Gantt bars and the active dependency path
relatedvw-is-relatedGraph nodes and edges next to the selection, and Gantt dependency paths that touch a selected bar
highlightedvw-is-highlightedGantt dependency paths and their lag labels in highlightedDependencyIds, and Gantt bars in highlightedBarIds
activevw-is-activePressed connection handles, the active graph edge and Gantt dependency hit areas, pressed Gantt link handles and the column resize separator being dragged
panningvw-is-panningThe graph stage while it is panned
draggablevw-is-draggableGraph nodes that can be dragged
collapsedvw-is-collapsedGroup toggles of collapsed graph groups
solid, outlinevw-is-solid, vw-is-outlineGantt bars, from TimelineBar.appearance
editablevw-is-editableEditable Gantt bars
draggingvw-is-draggingGantt bars with a pending preview and the progress slider being dragged, and a constraint handle being dragged
milestonevw-is-milestoneZero-duration Gantt bars
first, lastvw-is-first, vw-is-lastThe start and end resize handles of a Gantt bar (vw-bar-handle)
start, finishvw-is-start, vw-is-finishThe start and finish link handles of a Gantt bar (vw-gantt-link-handle)
endvw-is-endThe tick label at the end of the Gantt range
overloaded, idlevw-is-overloaded, vw-is-idleGantt load segments above capacity or without load

Two modifiers appear only with opt-in content: vw-is-unstyled on graph node groups rendered by a node slot with unstyledNodeSlots, and vw-has-slot on Gantt milestones rendered with a bar slot.

The tone classes (vw-tone-*), the theme classes (vw-theme-dark, vw-theme-auto) and the other vw- classes, such as vw-critical, vw-dimmed and vw-rtl, were not renamed in 0.2.0.

Built-in dark theme ​

Add vw-theme-dark to a component root or any ancestor to apply a dark value to every --vw-* variable, including --vw-dimmed-opacity, --vw-now, --vw-load, --vw-load-overload, --vw-load-capacity, --vw-non-working, --vw-critical, --vw-float, --vw-deadline, --vw-cascade, --vw-background-pattern, --vw-guide, --vw-status, --vw-constraint, --vw-constraint-violated, --vw-range, --vw-range-line, --vw-range-ink, the tone families, --vw-marker-ink and the component variables of TaskBoard and TreeGrid. Add vw-theme-auto instead to apply the same values only while prefers-color-scheme: dark matches. Both are opt-in, so the default appearance is unchanged. Variables you set on a descendant still win, and the demo's own .dark class keeps working. On a GanttChart root the class also paints the surface background and sets color-scheme: dark. The dark palette keeps text/surface contrast above 7:1 (4.5:1 minimum for every text pair).

--vw-marker-ink (default #fff) is the text colour on marker and now-marker labels, including in SVG and PNG exports (the markerInk export theme colour). In the dark theme the solid tones are light and --vw-on-solid is dark.

Media queries ​

  • @media (forced-colors: active): always on. Nodes, bars, edges, dependency lines, handles, progress, load overload (hatched), capacity line, the now marker, non-working shading (hatched with GrayText), critical outlines (double border), float lines, deadline indicators, late outlines (dashed), segments, the progress slider, the tooltip border, the create and cascade previews (Highlight outlines without fill), the row drop indicator, the column resize separators (CanvasText), the graph background pattern (GrayText), alignment guides (Highlight), node shapes (like node rectangles), hollow edge markers (Canvas inside an outline in the edge colour), the status-date line (a thick CanvasText line), the progress line (dashed CanvasText), dependency lag labels (CanvasText on a Canvas halo), marker range bands (hatched with CanvasText) and labels (CanvasText on Canvas) scheduling constraint markers and handles (CanvasText on a Canvas halo, a violated one with a dashed stem, a focused handle with a Highlight outline) and swimlanes (Canvas bands outlined in CanvasText, every second band dashed, headers with a thicker border and CanvasText titles), selection and focus use system colours (CanvasText, Highlight, HighlightText, GrayText) with forced-color-adjust: none on the affected elements. Selection is also shown by outline or thicker strokes, not colour alone.
  • @media (prefers-reduced-motion: reduce): the stylesheet disables transitions and animations inside both components; animated graph edges stay dashed but still. Drag auto-scroll in GanttChart runs through requestAnimationFrame in JavaScript and is not affected.
  • @media print: zoom and preset controls, the minimap, bar and connection handles, progress sliders, the graph and Gantt tooltips, link hit targets and previews, the row add buttons, the row move handles and drop indicator, the column resize separators, the create and cascade previews, alignment guides, group toggles, waypoint and resize handles, and the Gantt toolbar are hidden; the status-date and progress lines, marker ranges and the scheduling constraint markers (also those drawn as handles) are printed, animated graph edges print dashed without motion, and the graph background pattern is printed like the default backdrop. Backgrounds, including non-working shading, are kept with print-color-adjust: exact, the Gantt scroller expands (height: auto, overflow: visible) and rows avoid page breaks. CSS alone cannot print content outside the DOM: virtualized rows and time windows, graph elements culled with cullOffscreen, and the part of a graph outside the current camera are not rendered, so a very large chart prints only what is mounted. Use a dedicated export for complete output.

Supply partial labels objects to translate controls and accessible names. The row-heading and empty slots provide full control over those regions. Data labels and formatTime belong to the caller.

Right-to-left languages ​

Set dir="rtl" on a component for a right-to-left interface, or dir="auto" to follow the direction inherited from the page (for example <html dir="rtl">). The default ltr leaves rendering unchanged; in a right-to-left page it keeps the inherited direction, which the timeline does not support, so pass rtl or auto there.

vue
<GanttChart dir="rtl" :rows="rows" :bars="bars" :range="range" :format-time="formatTime" @edit="apply" />

The timeline then runs from right to left and its row headings sit on the right. Edit proposals keep the same times and units, so validation and persistence code needs no change. Arrow keys follow the screen: ArrowLeft makes a bar later. Translate the edit hint through labels.editHint to describe this to screen reader users. auto is resolved after mounting, so server-rendered markup is left-to-right until hydration; use an explicit rtl for server rendering.

auto reads the inherited direction at mount, when the dir prop changes and when the dir attribute of an ancestor changes, for example when the user switches language at runtime and the application sets <html dir>. A MutationObserver on the ancestors' dir attributes does this while dir is auto and is disconnected on unmount. A change of direction cancels a gesture in flight; GanttChart also keeps the time at the inline-start edge in view. A direction set only through the CSS direction property, a class or a stylesheet change is not observed: bind dir to your language state, or re-key the component (:key="locale"), in that case.

The right-to-left rules are scoped to the vw-rtl class and use CSS logical properties. Custom slot content inherits direction: rtl. For NetworkGraph, dir only moves the controls and right-aligns labels (swimlane titles included); choose options.direction: 'RL' to lay out ranks from right to left.

Right-to-left layout ​

Both components take an opt-in dir prop of type ChartDirection.

ValueBehavior
ltr (default)Unchanged left-to-right rendering. No dir attribute is written.
rtlWrites dir="rtl" on the component root and adds the vw-rtl class. Server rendering already produces right-to-left markup.
autoWrites no attribute and follows the CSS direction inherited by the component root, read after mounting, whenever dir changes and whenever an ancestor's dir attribute changes (observed with a MutationObserver while dir is auto). A change of direction cancels a gesture in flight. Direction changes made only through CSS are not observed. Server rendering and the first client render are left-to-right.

In a right-to-left GanttChart the row heading column and columns sit on the right and time increases from right to left. Header bands, ticks, the grid, non-working shading, bars, progress, segments, float lines, deadline indicators, scheduling constraint markers and handles (their flags point the other way, towards the allowed times), baselines, summaries, markers, marker ranges and their header labels, the now line, the status-date and progress lines, dependency paths and lag label positions (the label text itself is not mirrored), link and reconnect handles and load histogram rows are mirrored. Positions are measured from the inline-start (right) edge, so TimelineEdit proposals, validateEdit, scrollToTime(time) (which puts time at the right edge of the time area), keeping the centered time on zoom and preset changes, pinch and wheel zoom anchoring, autoscroll near either edge and keyboard reveal all work in the same time units as in LTR. The scroll container uses the standard right-to-left convention in which scrollLeft is 0 at the start and negative after scrolling towards later times; browsers that report positive values are not supported. Switching direction cancels an in-flight gesture and keeps the time at the inline-start edge in view.

Keyboard editing follows the visual direction. In RTL, ArrowLeft moves a focused editable bar one snap later and ArrowRight one snap earlier. Shift with an arrow moves the end and Alt with an arrow moves the start, in the same visual direction (Shift+ArrowLeft makes the bar end later). Up and Down (with rowDraggable) are unchanged. Pointer drags follow the pointer: dragging left moves later. The start resize handle is on the right edge of a bar and the end handle on the left. When a dependency is dropped on a bar body, the right half picks the start and the left half the finish. The collapsed-row toggle shows ◂ instead of ▸.

In a right-to-left NetworkGraph only the chrome changes: the zoom tools and the minimap move to the bottom-left corner, node titles and details, group labels, swimlane titles and edge labels are right-aligned with direction: rtl, and the default node text is anchored at the box's right edge. Layout geometry, edge routes, camera, panning keys and saved positions are unchanged; use options.direction: 'RL' to mirror the layout itself. Custom node slots own their own text alignment.

exportSvg and exportPng follow the component's direction. In the core, renderTimelineSvg, renderGraphSvg, renderTaskBoardSvg, renderEventCalendarSvg and renderTreeGridSvg take direction: 'rtl', which writes direction="rtl" and unicode-bidi="embed" on the text, TaskBoard count badges included. Where EventCalendar isolates an event time (direction: ltr; unicode-bidi: isolate), the right-to-left calendar export writes the time as its own left-to-right <text> run whose right end is at the inline start, and a title that shares its line as a separate right-to-left run to its left, placed by the estimated width of the time, so 21:00–22:00 and 9:00 PM keep their order and stay at the inline start without relying on the renderer's bidi resolution; left-to-right output keeps the time and title in one run. <title> texts are not changed. and mirrorTimeScale(scale) returns a scale with toX(range.start) = width and toX(range.end) = 0; its round trips are exact whenever those of scale are and the pixel values are exactly representable.

Released under the MIT License.