Structures
The following structures are available globally.
-
A flexible, reusable card component that adapts to the current theme.
The
Cardview provides a styled container with rounded corners, background color, shadow elevation, and optional padding. It is ideal for grouping related content in a visually distinct block.Example usage:
Card { Text("Profile details") }The card uses the current
See moreThemefrom the environment to style its appearance.Declaration
Swift
@MainActor public struct Card<Content> : View where Content : View -
A custom themed checkbox component that adapts to the current
Theme.Checkboxsupports both text labels and custom views, as well as configurable shape and label alignment. It is fully accessible and updates the boundisCheckedstate when toggled.Example:
Checkbox(isChecked: $isOn, label: "Subscribe to newsletter")You can also provide a custom view as a label:
See moreCheckbox(isChecked: $isOn) { HStack { Image(systemName: "bell") Text("Notify me") } }Declaration
Swift
@MainActor public struct Checkbox : View -
A customizable radio button component that conforms to the current
Theme.RadioButtonsupports genericHashablevalues and automatically updates the selected value. You can display a custom label on either side of the button.Example:
See moreRadioButton(selection: $selectedOption, value: .optionA, labelPosition: .trailing) { Text("Option A") }Declaration
Swift
@MainActor public struct RadioButton<T> : View where T : Hashable -
A vertically stacked group of radio buttons bound to a single selection.
RadioGroupallows presenting multiple options where only one can be selected at a time. It supports both simpleStringlabels or custom label views.
See moreRadioGroup(selection: $selectedOption, options: MyEnum.allCases) { option in Text(option.rawValue) }Declaration
Swift
@MainActor public struct RadioGroup<T> : View where T : Hashable -
A SwiftUI view that renders a shape using a color defined in the current theme.
ThemedShapeallows developers to apply consistent, theme-based coloring to any SwiftUIShape, leveraging theColorTokensystem fromTheme.colors.The actual color is resolved from the current
Themeinjected in the environment viaThemeProvider.Example usage:
ThemedShape(shape: Circle(), color: .accent) .frame(width: 50, height: 50)See moreNote
Ensure the view hierarchy is wrapped in aThemeProviderso thethemeenvironment is properly available.Declaration
Swift
@MainActor public struct ThemedShape<S> : View where S : Shape -
A complete representation of a visual theme including color, typography, spacing, radius, and shadow tokens. The
See moreThemestruct is the root context for all styling logic in a themed SwiftUI application.Declaration
Swift
public struct Theme -
Undocumented
See moreDeclaration
Swift
public struct ThemeButtonDefaults -
A struct that defines all semantic colors used across the UI theme.
Colors follow the Material Design 3 specification and are resolved from a
See moreTheme. These values can be accessed via environment using@Environment(\.appTheme).colorsor via subscript using aColorToken.Declaration
Swift
public struct ThemeColors -
Defines standard corner radius values used throughout the design system.
See moreDeclaration
Swift
public struct ThemeRadii -
Defines a shadow style for UI elements, including color, blur radius, and offset values. Used to indicate elevation, depth, or focus across your app.
See moreDeclaration
Swift
public struct ThemeShadow : Equatable -
A collection of predefined shadow styles used to indicate elevation, depth, or focus across the UI.
See moreDeclaration
Swift
public struct ThemeShadows -
Undocumented
See moreDeclaration
Swift
public struct ThemeShapes -
Defines the standard spacing scale for layout and padding/margin values throughout the app.
See moreDeclaration
Swift
public struct ThemeSpacing -
Defines a typography scale for use across an application, providing visual hierarchy and consistent font styling.
See moreDeclaration
Swift
public struct ThemeTypography -
A view modifier that sets a themed navigation title using your design system’s typography.
This modifier allows applying a custom
TextStyleTokenand optionalFont.Weightto the navigation title in a consistent way across screens.- Works with
.navigationBarTitleDisplayMode(.inline) - Compatible with iOS, macOS, and tvOS
Example:
See moreContentView() .modifier(ThemedNavigationTitleModifier(title: "Profile", token: .headlineLarge))Declaration
Swift
@MainActor public struct ThemedNavigationTitleModifier : ViewModifierParameters
titleThe navigation bar title string.
tokenThe text style token from the theme’s typography (e.g.
.headlineLarge,.titleMedium).weightOptional override for font weight (e.g.
.bold,.semibold). - Works with
-
A comprehensive button style that applies consistent theming across different button variants, shapes, sizes, and font styles.
ThemeButtonStylesupports:- Filled, Tonal, Outline, Elevated, and Text button variants
- Destructive role styling (uses error colors)
- Dynamic background and border colors for enabled, disabled, and pressed states
- Adaptive padding, shape, font, and shadow based on theme tokens
Example:
Button("Save") { ... } .buttonStyle(ThemeButtonStyle(variant: .filled, size: .large))Use this style in conjunction with
See moreapplyThemeButtonStyle(),buttonVariant(), etc. for more declarative usage in your design system.Declaration
Swift
@MainActor public struct ThemeButtonStyle : ButtonStyleParameters
variantThe visual variant of the button (e.g.,
.filled,.outline, etc.).sizeThe padding and font size configuration.
shapeThe corner style for the button.
fontOptional override for the font style and weight.
-
A custom text field style that applies theming based on a
Themecontext.This style supports Material-style variants like
See morefilled,outlined, andunderlined, and adjusts typography, padding, shape, color, and focus indicators accordingly.Declaration
Swift
public struct ThemeTextFieldStyle : TextFieldStyleParameters
variantThe visual style of the field (e.g.
.filled,.outlined,.underlined).sizeThe field size which controls padding and font.
shapeThe shape used to clip and stroke the background (e.g. rounded, capsule).
fontOptional font override using a
ThemeFontToken. Ifnil, falls back to size-defined font.isErrorWhether to display the error state (e.g. red border and text).
-
A SwiftUI view that injects a visual theme (
Theme) into the environment based on the system color scheme.Use
See moreThemeProviderto wrap your app or specific view hierarchies and enable access to the current theme via@Environment(\.appTheme). It automatically switches between light and dark theme variants.Declaration
Swift
@MainActor public struct ThemeProvider<Content> : View where Content : View -
Defines the stroke widths used throughout the design system.
See moreDeclaration
Swift
public struct ThemeStroke -
Undocumented
See moreDeclaration
Swift
public struct ThemeTextFieldDefaults -
Undocumented
See moreDeclaration
Swift
public struct ThemeFontToken
Structures Reference