https://github.com/stanfordspezi/spezionboarding
Spezi Onboarding module to inform a user or retrieve consent for a study participation
https://github.com/stanfordspezi/spezionboarding
consent ios onboarding spezi stanford swift swiftui welcome xcode
Last synced: 6 months ago
JSON representation
Spezi Onboarding module to inform a user or retrieve consent for a study participation
- Host: GitHub
- URL: https://github.com/stanfordspezi/spezionboarding
- Owner: StanfordSpezi
- License: mit
- Created: 2023-04-05T17:18:31.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T18:07:42.000Z (about 1 year ago)
- Last Synced: 2025-04-10T07:05:26.878Z (about 1 year ago)
- Topics: consent, ios, onboarding, spezi, stanford, swift, swiftui, welcome, xcode
- Language: Swift
- Homepage: https://swiftpackageindex.com/StanfordSpezi/SpeziOnboarding/documentation/
- Size: 1.4 MB
- Stars: 14
- Watchers: 11
- Forks: 7
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Spezi Onboarding
[](https://github.com/StanfordSpezi/SpeziOnboarding/actions/workflows/build-and-test.yml)
[](https://codecov.io/gh/StanfordSpezi/SpeziOnboarding)
[](https://doi.org/10.5281/zenodo.7806970)
[](https://swiftpackageindex.com/StanfordSpezi/SpeziOnboarding)
[](https://swiftpackageindex.com/StanfordSpezi/SpeziOnboarding)
Provides UI components for Onboarding.
## Overview
The [`SpeziOnboarding`](https://swiftpackageindex.com/stanfordspezi/spezionboarding/documentation/spezionboarding) module provides user interface components to onboard a user to an iOS application.
OnboardingView
SequentialOnboardingView
OnboardingConsentView
## Setup
### Add Spezi Onboarding as a Dependency
You need to add the Spezi Onboarding Swift package to
[your app in Xcode](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#) or
[Swift package](https://developer.apple.com/documentation/xcode/creating-a-standalone-swift-package-with-xcode#Add-a-dependency-on-another-Swift-package).
## Examples
### Onboarding View
The [`OnboardingView`](https://swiftpackageindex.com/stanfordspezi/spezionboarding/documentation/spezionboarding/onboardingview) allows you to separate information into areas on a screen, each with a title, description, and icon.
```swift
import SpeziOnboarding
import SwiftUI
struct OnboardingViewExample: View {
var body: some View {
OnboardingView(
title: "Welcome",
subtitle: "This is an example onboarding view",
areas: [
.init(
icon: Image(systemName: "tortoise.fill"),
title: "Tortoise",
description: "A Tortoise!"
),
.init(
icon: {
Image(systemName: "lizard.fill")
.foregroundColor(.green)
},
title: "Lizard",
description: "A Lizard!"
),
.init(
icon: {
Circle().fill(.orange)
},
title: "Circle",
description: "A Circle!"
)
],
actionText: "Learn More",
action: {
// Action to perform when the user taps the action button.
}
)
}
}
```
### Sequential Onboarding View
The [`SequentialOnboardingView`](https://swiftpackageindex.com/stanfordspezi/spezionboarding/documentation/spezionboarding/sequentialonboardingview) allows you to display information step-by-step with each additional area appearing when the user taps the `Continue` button.
```swift
import SpeziOnboarding
import SwiftUI
struct SequentialOnboardingViewExample: View {
var body: some View {
SequentialOnboardingView(
title: "Things to know",
subtitle: "And you should pay close attention ...",
steps: [
.init(
title: "A thing to know",
description: "This is a first thing that you should know; read carefully!"
),
.init(
title: "Second thing to know",
description: "This is a second thing that you should know; read carefully!"
),
.init(
title: "Third thing to know",
description: "This is a third thing that you should know; read carefully!"
)
],
actionText: "Continue"
) {
// Action to perform when the user has viewed all the steps
}
}
}
```
## The Spezi Template Application
The [Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication) provides a great starting point and example using the `SpeziOnboarding` module.
## Contributing
Contributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) first.
## License
This project is licensed under the MIT License. See [Licenses](https://github.com/StanfordSpezi/SpeziOnboarding/tree/main/LICENSES) for more information.

