@molecule/app-onboarding-modal-solid

Feature · onboarding-modal · App (browser) · v1.1.2 · Apache-2.0

Multi-step welcome / onboarding overlay with prev/next + skip

npm install @molecule/app-onboarding-modal-solid

npm · Source on GitHub

How it works

@molecule/app-onboarding-modal-solid is a ready-made onboarding-modal feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { createSignal } from 'solid-js'
import { OnboardingModal, type OnboardingStep } from '@molecule/app-onboarding-modal-solid'

const steps: OnboardingStep[] = [
  { id: 'welcome', title: 'Welcome!', body: 'Let us show you around.' },
  { id: 'features', title: 'Key Features', body: 'Build apps in minutes.' },
  { id: 'done', title: "You're all set", body: 'Start your first project.' },
]

export function Onboarding() {
  const [open, setOpen] = createSignal(true)
  return (
    <OnboardingModal
      open={open()}
      steps={steps}
      onClose={() => setOpen(false)}
      onComplete={() => setOpen(false)}
    />
  )
}

Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid multi-step onboarding overlay.

Exports <OnboardingModal> and the OnboardingStep type. It is the Solid counterpart of @molecule/app-onboarding-modal-react: the same props (React names), the same DOM for the same input, and the same onClose / onComplete calls, so an app switches framework by changing only the package name in its imports.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { createSignal } from 'solid-js'
import { OnboardingModal, type OnboardingStep } from '@molecule/app-onboarding-modal-solid'

const steps: OnboardingStep[] = [
  { id: 'welcome', title: 'Welcome!', body: 'Let us show you around.' },
  { id: 'features', title: 'Key Features', body: 'Build apps in minutes.' },
  { id: 'done', title: "You're all set", body: 'Start your first project.' },
]

export function Onboarding() {
  const [open, setOpen] = createSignal(true)
  return (
    <OnboardingModal
      open={open()}
      steps={steps}
      onClose={() => setOpen(false)}
      onComplete={() => setOpen(false)}
    />
  )
}

Type

feature

Installation

npm install @molecule/app-onboarding-modal-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

OnboardingStep

A single step in an onboarding flow, with a title, body, and optional media. Node-valued fields take a Solid JSX value (or a plain string) instead of a React node; the conformance kit supplies them as accessors, which Solid's JSX renders where they are inserted.

interface OnboardingStep {
  /** Stable identity, used as the step dot's key. */
  id: string
  /** Step heading. */
  title: JSX.Element
  /** Step body. */
  body: JSX.Element
  /** Optional media / illustration. */
  media?: JSX.Element
}

OnboardingModalProps

Props accepted by the OnboardingModal component.

interface OnboardingModalProps {
  /** Whether the modal is open. */
  open: boolean
  /** Called when closing (skip / X / completion). React passes the click event for Skip and the chrome close button. */
  onClose?: (event?: unknown) => void
  /** Onboarding steps. */
  steps: OnboardingStep[]
  /** Called when the user clicks "Done" on the last step. */
  onComplete?: () => void
  /** Show "Skip" link in the footer. Defaults to true. */
  allowSkip?: boolean
  /** Initial step index (uncontrolled). */
  defaultStep?: number
}

Functions

OnboardingModal(props)

Multi-step onboarding overlay — title + body + media, with prev/next navigation and an optional Skip link. Tracks its own step state.

Step position is UNCONTROLLED and persists across close/reopen — a user who closed on step 3 reopens on step 3. Remount the component to restart from defaultStep. onComplete fires only from the final-step button; closing via Skip or the chrome close button calls onClose alone — persist "onboarding seen" in onClose if skipping should count as done.

function OnboardingModal(props: OnboardingModalProps): JSX.Element
  • props — Component props (see OnboardingModalProps).

Returns: The rendered onboarding overlay, or nothing when there are no steps.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid
  • @molecule/app-ui
  • @molecule/app-ui-solid
  • solid-js

Requires a wired ClassMap bond and a Solid i18n provider ancestor — the composed Modal / Button (from @molecule/app-ui-solid) and useTranslation() all depend on them. Pair with @molecule/app-locales-onboarding-modal for the Skip / Back / Next / Get-started strings in 79 languages.

Step position is UNCONTROLLED and persists across close/reopen — a user who closed on step 3 reopens on step 3. Remount the component to restart from defaultStep. onComplete fires only from the final-step button; closing via Skip or the chrome close button calls onClose alone — persist "onboarding seen" in onClose if skipping should count as done.

Translations

Translation strings are provided by @molecule/app-locales-onboarding-modal.