Shape of the onboarding context value provided to consumers. Combines state and action properties for complete onboarding flow control.

interface OnboardingContextType {
isActive: boolean;
currentStep: OnboardingStep;
completedSteps: OnboardingStep[];
stepProgress: Record<OnboardingStep, boolean>;

// Actions
startOnboarding: () => void;
completeStep: (step: OnboardingStep) => void;
skipStep: (step: OnboardingStep) => void;
goToStep: (step: OnboardingStep) => void;
nextStep: () => void;
previousStep: () => void;
finishOnboarding: () => void;
resetOnboarding: () => void;
dismissOnboarding: () => void;

// Queries
isStepCompleted: (step: OnboardingStep) => boolean;
isStepActive: (step: OnboardingStep) => boolean;
getStepProgress: () => number;
}
interface OnboardingContextType {
    isActive: boolean;
    currentStep: OnboardingStep;
    completedSteps: OnboardingStep[];
    stepProgress: Record<OnboardingStep, boolean>;
    startOnboarding: () => void;
    completeStep: (step: OnboardingStep) => void;
    skipStep: (step: OnboardingStep) => void;
    goToStep: (step: OnboardingStep) => void;
    nextStep: () => void;
    previousStep: () => void;
    finishOnboarding: () => void;
    resetOnboarding: () => void;
    dismissOnboarding: () => void;
    isStepCompleted: (step: OnboardingStep) => boolean;
    isStepActive: (step: OnboardingStep) => boolean;
    getStepProgress: () => number;
}

Properties

isActive: boolean

Whether the onboarding flow is currently active.

currentStep: OnboardingStep

The step currently being displayed or processed.

completedSteps: OnboardingStep[]

Array of steps marked as completed.

stepProgress: Record<OnboardingStep, boolean>

Object mapping each step to completion status.

startOnboarding: () => void

Initiates the onboarding flow from the beginning.

completeStep: (step: OnboardingStep) => void

Marks a step as completed and persists to storage.

skipStep: (step: OnboardingStep) => void

Skips a step (marks as completed to allow progression).

goToStep: (step: OnboardingStep) => void

Navigates directly to a specific step.

nextStep: () => void

Advances to the next step in sequence.

previousStep: () => void

Goes back to the previous step.

finishOnboarding: () => void

Marks onboarding as complete and closes the flow.

resetOnboarding: () => void

Clears all progress and restarts from the beginning.

dismissOnboarding: () => void

Hides onboarding without resetting progress.

isStepCompleted: (step: OnboardingStep) => boolean

Query function to check if a step is completed.

isStepActive: (step: OnboardingStep) => boolean

Query function to check if a step is currently active.

getStepProgress: () => number

Returns progress percentage (0-100).