Solid API reference
The Solid adapter (@glowhop/solid-tour) exports components, hooks, and utility functions.
Functions
Section titled “Functions”createGlowTour(options?)
Section titled “createGlowTour(options?)”Creates a tour controller instance. Inherited from Core.
Signature:
function createGlowTour(options?: GlowTourOptions): TourComponents
Section titled “Components”DefaultTour
Section titled “DefaultTour”Pre-composed tour with overlay, popover, pointer, and all navigation buttons.
Props:
interface DefaultTourProps { tour: Tour}Usage:
<DefaultTour tour={tour} />GlowTour.*
Section titled “GlowTour.*”Composition primitives for custom layouts:
GlowTour.Root- Root containerGlowTour.Overlay- Backdrop overlayGlowTour.Pointer- Decorative indicator/arrowGlowTour.Popover- Dialog containerGlowTour.Header- Title areaGlowTour.Content- Description areaGlowTour.Footer- Navigation button containerGlowTour.AdvanceTrigger- Next step buttonGlowTour.BackTrigger- Previous step buttonGlowTour.CancelTrigger- Dismiss button
These components are also available as flat named exports: Root, Overlay, Pointer, Popover, Header, Content, Footer, AdvanceTrigger, BackTrigger, CancelTrigger.
Props (all components):
interface ComponentProps { tour?: Tour class?: string style?: CSSProperties}GlowTour.Pointer (detailed)
Section titled “GlowTour.Pointer (detailed)”Customizes the directional content (emoji or custom content) of the pointer indicator.
Props:
interface PointerProps extends ComponentProps { as?: ValidComponent directionContent?: { top?: JSX.Element bottom?: JSX.Element left?: JSX.Element right?: JSX.Element }}Default glyphs (when directionContent is not set):
top:👆bottom:👇left:👈right:👉
Usage (with custom content):
<GlowTour.Pointer directionContent={{ top: "⬆️", bottom: "⬇️", left: "⬅️", right: "➡️" }}/>Usage (with custom element):
<GlowTour.Pointer directionContent={{ bottom: <span class="custom-pointer">↓</span> }}/>Usage (default pointers):
<GlowTour.Root tour={tour}> <GlowTour.Overlay /> <GlowTour.Pointer /> <GlowTour.Popover> <GlowTour.Header /> <GlowTour.Content /> <GlowTour.Footer> <GlowTour.CancelTrigger /> <GlowTour.AdvanceTrigger /> </GlowTour.Footer> </GlowTour.Popover></GlowTour.Root>useTour()
Section titled “useTour()”Returns reactive tour state via Solid signals. Must be called inside <GlowTour.Root tour={...}>.
Signature:
function useTour(): Accessor<TourState<SolidTourContent>>Returns (accessor):
() => { name: string totalSteps: number currentStepIndex: number currentStep: TourCurrentStep<SolidTourContent> | null direction: "advance" | "previous" canAdvance: boolean canPrevious: boolean canCancel: boolean isFirstStep: boolean isLastStep: boolean status: "idle" | "starting" | "transitioning" | "active" | "finished" | "cancelled" | "error" | "disposed" error: Error | null}Usage:
import { useTour } from "@glowhop/solid-tour";
const state = useTour();
return ( <div> <p>Status: {state().status}</p> <button disabled={!state().canAdvance} onClick={() => tour.advance()}> Next </button> </div>);Tour- Tour controllerTourState- Tour stateWorkflowDefinition- Immutable workflowStepPropsStore- Step state storeSolidTourContent- Solid content typePointerDirectionContent- Content configuration forPointercomponent directionsGlowTourOptions- Options forcreateGlowTourStartOptions- Options fortour.create
Exports
Section titled “Exports”export type { GlowTourOptions, StartOptions } from "@glowhop/core-tour";export { DefaultTour, type DefaultTourProps } from "./components/default-tour";export { AdvanceTrigger, BackTrigger, CancelTrigger, Content, Footer, GlowTour, Header, Overlay, Pointer, Popover, Root, useTour,} from "./components/tour-components";export type { SolidTourContent, StepPropsStore, Tour, TourState, WorkflowDefinition,} from "./glow-tour";export { createGlowTour } from "./glow-tour";