screens/DSOnboardingFlow
DSOnboardingFlow
screensMulti-step onboarding flow with a step indicator, transition animations between screens, forward/back buttons, and a skip option.
iOS 17+
Purpose
Introduce new features or guide users through initial app setup. Reduces churn in first sessions.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| stepsreq | [DSOnboardingStep] | — | Array of steps with icon, title, body, and an optional custom view. |
| onCompletereq | (() -> Void) | — | Callback on completion. |
| onSkip | (() -> Void)? | nil | Allows skipping the onboarding. |
| accentColor | Color | DSColor.primary | Colour of highlighted elements. |
Examples
Initial onboarding
3 introduction screens.
swift
DSOnboardingFlow(
steps: [
DSOnboardingStep(
icon: "sparkles",
title: "Welcome to Acme",
body: "The fastest platform to manage your projects.",
accentColor: DSColor.primary
),
DSOnboardingStep(
icon: "person.2.fill",
title: "Collaborate as a team",
body: "Invite members and work together in real time.",
accentColor: DSColor.accent
),
DSOnboardingStep(
icon: "chart.line.uptrend.xyaxis",
title: "Track progress",
body: "Automatic dashboards and reports for faster decisions.",
accentColor: DSColor.success
),
],
onComplete: { appState.didCompleteOnboarding = true },
onSkip: { appState.didCompleteOnboarding = true }
)Usage Guidelines
- Maximum of 4 steps per flow. Above that, consider splitting into sub-flows.
- Always offer a skip option for experienced users.
- Avoid dense text; prefer icons and short phrases.