Skip to content

index ​

Interfaces ​

InterfaceDescription
Driver-
GetConfig-
GetState-

Type Aliases ​

Type AliasDescription
Alignment-
AllowedButtons-
Config-
DriverComponentsdriver-vue addition: global component overrides.
DriverHook-
DriverInternalMethods the rendering components call back into; not part of the public API.
DriverPluginOptions-
DriverStateThe reactive, Vue-facing state of a driver. Read it through driver.state or the refs returned by useDriver(); the engine owns every write.
DriveStep-
HookOpts-
OverlaySlotPropsScope of the overlay slot.
Popover-
PopoverDOMThe DOM of a rendered popover, handed to onPopoverRender. With the default DriverPopover every part is present; a custom popover component or a slot that omits a part leaves the corresponding key null.
PopoverRenderModelEverything a popover needs to render, fully resolved against the step and the config. Consumed by <DriverPopover>, slots and custom components.
PopoverSlotPropsWhat every popover slot and custom popover component receives.
SetState-
Side-
StageOptions-
StageRectThe cutout rectangle, in viewport coordinates, without the stage padding.
StageSlotPropsScope of the stage slot.
StateThe state shape driver.js exposes through getState() and the hook options. Kept for parity; prefer DriverState in Vue code.
TourScopeThe tour context added by <DriverTour> to every slot.
TourSlotProps-
UseDriverOptions-
UseDriverPositionOptions-
UseDriverPositionReturn-
UseDriverReturn-
Viewport-

Variables ​

VariableDescription
ARROW_CORNER_INSET-
ARROW_SIZEThe default arrow is a 10x10 CSS triangle; a larger one is measured from the DOM.
driverdriver.js-compatible alias of createDriver.
DRIVER_DEFAULTS_KEYConfig defaults merged under every useDriver() config.
DRIVER_KEYThe app-wide shared driver, created lazily on first use.
DriverPluginThe plugin with no preset options; pass options to app.use.
DriverTour-
injectDriverThe nearest provided driver: one from useDriver() in an ancestor, from provideDriver(), or the app-wide one from DriverPlugin (created on first access).
VIEWPORT_PADDINGThe viewport padding the popover keeps clear of the edges.

Functions ​

FunctionDescription
arrowOffsetAlongThe arrow's offset along one popover edge, relative to the popover's leading edge. It aims at the middle of the stretch where element and popover overlap (or at the nearest corner when they do not overlap) and stays clear of the rounded corners. An element spanning the whole edge leaves the choice to the alignment, so the arrow echoes it.
createDriverCreate a driver: the tour engine. It owns the config, the reactive state (driver.state) and every behaviour of driver.js; rendering is left to <DriverTour> (or your own components reading driver.state).
createDriverPluginInstalls driver-vue: provides the config defaults and a lazily created shared driver (used by <DriverTour> without a driver prop and by useDriver() with { shared: true }), and optionally registers the components globally.
easeInOutQuadThe driver.js default easing, in normalized form (t and the result are 0..1).
generateStageSvgPathString-
getPaddedStageThe padded cutout box (what the overlay cuts out and what .driver-stage covers).
getViewport-
injectDriverDefaultsThe config defaults installed by DriverPlugin, or an empty object.
provideDriverProvide a driver to the subtree; <DriverTour> and useDriver({ shared: true }) pick it up.
resolveArrowSideDecides which popover edge the arrow sits on. Normally the rendered side, but when the element scrolls clear of the popover along that side's axis (a left-placed popover whose element has scrolled above it), the arrow moves to the perpendicular edge so it keeps pointing at the element.
useDriverCreates a driver bound to the current component: the plugin defaults are merged under config, a reactive config is re-applied on change, the driver is provided to the component's subtree (so a <DriverTour /> there renders it), and the tour is destroyed when the component unmounts.
useDriverPositionPositions a popover against an element (or a rect) with Floating UI, with driver.js semantics: the requested side is kept while it has room, then the opposite and the perpendicular sides are tried; the popover shifts to stay in the viewport (so it sticks to the edge while its element scrolls away), and the arrow keeps pointing at the element. The rendered side and alignment are exposed so class names can reflect them.

References ​

DriverBoxOverlay ​

Renames and re-exports DriverTour


DriverOverlay ​

Renames and re-exports DriverTour


DriverPopover ​

Renames and re-exports DriverTour


DriverStage ​

Renames and re-exports DriverTour

Released under the MIT License.