OTFDesignSystem is TheraForge's design system framework that provides a set of UI components and utilities for creating cohesive and visually appealing user interfaces in TheraForge applications.
Release 1.0.2
- Added OTFEmptyState component
- Added OTFMedicationCard component
- Added OTFStimuliCard component
- Added OTFPillButtonStyle
- Updated OTFSurveyCard layout
Release 1.0.1
- Added OTFSurveyCard component
- Added OTFMediaButtonStyle
Release 1.0.0
- Initial release of OTFDesignSystem
- Added OTFButtonStyles
- Added OTFInfoCardButton
OTFDesignSystem is a design system framework that facilitates the creation of visually consistent and user-friendly iOS applications. It offers a collection of SwiftUI UI components and utilities, allowing developers to build interfaces with ease and maintain a unified design across the application.
Add the following line to your Podfile:
pod 'OTFDesignSystem'Run pod install in your terminal.
This framework provides four custom button styles—Primary, Secondary, Tertiary, and Pill—that can be applied to SwiftUI's Button.
import SwiftUI
import OTFDesignSystem
struct MyView: View {
var body: some View {
Button("Primary Button") {
// Handle button tap
}
.buttonStyle(.otfPrimary)
}
}import SwiftUI
import OTFDesignSystem
struct MyView: View {
var body: some View {
Button("Secondary Button") {
// Handle button tap
}
.buttonStyle(.otfSecondary)
}
}import SwiftUI
import OTFDesignSystem
struct MyView: View {
var body: some View {
Button("Tertiary Button") {
// Handle button tap
}
.buttonStyle(.otfTertiary)
}
}import SwiftUI
import OTFDesignSystem
struct MyView: View {
var body: some View {
Button("Pill Button") {
// Handle button tap
}
.buttonStyle(.otfPill)
}
}import SwiftUI
import OTFDesignSystem
struct MyView: View {
var body: some View {
Button {
// Handle button tap
} label: {
Image(systemName: "backward.fill")
}
.buttonStyle(.otfMedia)
}
}The OTFInfoCard is a versatile component for presenting information with optional actions. It provides flexibility in defining the title, description, and actions, making it suitable for various scenarios.
import OTFDesignSystem
import SwiftUI
struct MyInfoCardView: View {
var body: some View {
OTFInfoCard(
title: "nutrition",
description: "Monitor your dietary habits effortlessly. Log your meals and snacks to keep a close eye on your nutritional intake.",
actions: [
.init(label: "Log Meals", style: .primary) {
// Handle action on Log Meals button
},
.init(label: "Analyze Nutrition", style: .secondary) {
// Handle action on Analyze Nutrition button
},
]
)
}
}The OTFSurveyCard is a component designed for displaying survey or questionnaire items in a visually appealing manner.
import SwiftUI
import OTFDesignSystem
struct ContentView: View {
var body: some View {
OTFSurveyCard(
title: "Mood Check",
description: "How are you feeling today?",
systemImage: "face.smiling.inverse",
callToAction: "Get Started",
hasBeenAnswered: false
) {
// Action to perform when tapped
}
}
}The OTFEmptyState component is used to display a message when there is no content to show.
import SwiftUI
import OTFDesignSystem
struct ContentView: View {
var body: some View {
OTFEmptyState(
"No Items Found",
systemName: "magnifyingglass",
message: "It looks like there’s nothing here yet. Start adding some items to get going!",
action: .init(label: "Add New Item", action: {
// Handle add stimulus action
})
)
}
}The OTFMedicationCard is designed to present medication details including name, dosage, and schedule.
import SwiftUI
import OTFDesignSystem
struct ContentView: View {
var body: some View {
OTFMedicationCard(
title: "Levodopa",
dosage: "100mg",
schedule: "08:00 AM",
isCompleted: false
) { newStatus in
// Handle status change
}
}
}The OTFStimuliCard is designed to present various stimuli options in a visually appealing manner.
import SwiftUI
import OTFDesignSystem
struct ContentView: View {
var body: some View {
OTFStimuliCard(
title: "Rhythmic Cues",
description: "Audio beats to help regulate your walking",
systemImage: "waveform",
tintColor: .blue
)
}
}This project is made available under the terms of a modified BSD license. See the LICENSE file.










