Structures

The following structures are available globally.

  • A flexible, reusable card component that adapts to the current theme.

    The Card view 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 Theme from the environment to style its appearance.

    See more

    Declaration

    Swift

    @MainActor
    public struct Card<Content> : View where Content : View
  • A custom themed checkbox component that adapts to the current Theme.

    Checkbox supports both text labels and custom views, as well as configurable shape and label alignment. It is fully accessible and updates the bound isChecked state when toggled.

    Example:

    Checkbox(isChecked: $isOn, label: "Subscribe to newsletter")
    

    You can also provide a custom view as a label:

    Checkbox(isChecked: $isOn) {
      HStack {
        Image(systemName: "bell")
        Text("Notify me")
      }
    }
    
    See more

    Declaration

    Swift

    @MainActor
    public struct Checkbox : View
  • A customizable radio button component that conforms to the current Theme.

    RadioButton supports generic Hashable values and automatically updates the selected value. You can display a custom label on either side of the button.

    Example:

    RadioButton(selection: $selectedOption, value: .optionA, labelPosition: .trailing) {
      Text("Option A")
    }
    
    See more

    Declaration

    Swift

    @MainActor
    public struct RadioButton<T> : View where T : Hashable
  • A vertically stacked group of radio buttons bound to a single selection.

    RadioGroup allows presenting multiple options where only one can be selected at a time. It supports both simple String labels or custom label views.

    RadioGroup(selection: $selectedOption, options: MyEnum.allCases) { option in
        Text(option.rawValue)
    }
    
    See more

    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.

    ThemedShape allows developers to apply consistent, theme-based coloring to any SwiftUI Shape, leveraging the ColorToken system from Theme.colors.

    The actual color is resolved from the current Theme injected in the environment via ThemeProvider.

    Example usage:

    ThemedShape(shape: Circle(), color: .accent)
        .frame(width: 50, height: 50)
    

    Note

    Ensure the view hierarchy is wrapped in a ThemeProvider so the theme environment is properly available.
    See more

    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 Theme struct is the root context for all styling logic in a themed SwiftUI application.

    See more

    Declaration

    Swift

    public struct Theme
  • Undocumented

    See more

    Declaration

    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 Theme. These values can be accessed via environment using @Environment(\.appTheme).colors or via subscript using a ColorToken.

    See more

    Declaration

    Swift

    public struct ThemeColors
  • Defines standard corner radius values used throughout the design system.

    See more

    Declaration

    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 more

    Declaration

    Swift

    public struct ThemeShadow : Equatable
  • A collection of predefined shadow styles used to indicate elevation, depth, or focus across the UI.

    See more

    Declaration

    Swift

    public struct ThemeShadows
  • Undocumented

    See more

    Declaration

    Swift

    public struct ThemeShapes
  • Defines the standard spacing scale for layout and padding/margin values throughout the app.

    See more

    Declaration

    Swift

    public struct ThemeSpacing
  • Defines a typography scale for use across an application, providing visual hierarchy and consistent font styling.

    See more

    Declaration

    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 TextStyleToken and optional Font.Weight to the navigation title in a consistent way across screens.

    • Works with .navigationBarTitleDisplayMode(.inline)
    • Compatible with iOS, macOS, and tvOS

    Example:

    ContentView()
      .modifier(ThemedNavigationTitleModifier(title: "Profile", token: .headlineLarge))
    
    See more

    Declaration

    Swift

    @MainActor
    public struct ThemedNavigationTitleModifier : ViewModifier

    Parameters

    title

    The navigation bar title string.

    token

    The text style token from the theme’s typography (e.g. .headlineLarge, .titleMedium).

    weight

    Optional override for font weight (e.g. .bold, .semibold).

  • A comprehensive button style that applies consistent theming across different button variants, shapes, sizes, and font styles.

    ThemeButtonStyle supports:

    • 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 applyThemeButtonStyle(), buttonVariant(), etc. for more declarative usage in your design system.

    See more

    Declaration

    Swift

    @MainActor
    public struct ThemeButtonStyle : ButtonStyle

    Parameters

    variant

    The visual variant of the button (e.g., .filled, .outline, etc.).

    size

    The padding and font size configuration.

    shape

    The corner style for the button.

    font

    Optional override for the font style and weight.

  • A custom text field style that applies theming based on a Theme context.

    This style supports Material-style variants like filled, outlined, and underlined, and adjusts typography, padding, shape, color, and focus indicators accordingly.

    See more

    Declaration

    Swift

    public struct ThemeTextFieldStyle : TextFieldStyle

    Parameters

    variant

    The visual style of the field (e.g. .filled, .outlined, .underlined).

    size

    The field size which controls padding and font.

    shape

    The shape used to clip and stroke the background (e.g. rounded, capsule).

    font

    Optional font override using a ThemeFontToken. If nil, falls back to size-defined font.

    isError

    Whether 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 ThemeProvider to 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.

    See more

    Declaration

    Swift

    @MainActor
    public struct ThemeProvider<Content> : View where Content : View
  • Defines the stroke widths used throughout the design system.

    See more

    Declaration

    Swift

    public struct ThemeStroke
  • Undocumented

    See more

    Declaration

    Swift

    public struct ThemeTextFieldDefaults
  • Undocumented

    See more

    Declaration

    Swift

    public struct ThemeFontToken