ThemeSpacing

public struct ThemeSpacing

Defines the standard spacing scale for layout and padding/margin values throughout the app.

  • xs

    Extra-small spacing. Used for tight gaps between small elements like icons or labels.

    Declaration

    Swift

    public let xs: CGFloat
  • sm

    Small spacing. Typically used for padding inside buttons, cards, or input fields.

    Declaration

    Swift

    public let sm: CGFloat
  • md

    Medium spacing. Ideal for spacing between grouped elements or sections.

    Declaration

    Swift

    public let md: CGFloat
  • lg

    Large spacing. Used for separating components or laying out screen-level spacing.

    Declaration

    Swift

    public let lg: CGFloat
  • xl

    Extra-large spacing. Often used for outer padding or generous layout gaps.

    Declaration

    Swift

    public let xl: CGFloat
  • xxl

    Double-extra-large spacing. Reserved for very large vertical spacing or whitespace-heavy layouts.

    Declaration

    Swift

    public let xxl: CGFloat
  • Default spacing scale based on common design system sizes.

    Declaration

    Swift

    public static let defaultLight: ThemeSpacing
  • Default spacing scale based on common design system sizes.

    Declaration

    Swift

    public static let defaultDark: ThemeSpacing
  • Undocumented

    Declaration

    Swift

    public init(xs: CGFloat, sm: CGFloat, md: CGFloat, lg: CGFloat, xl: CGFloat, xxl: CGFloat)
  • Returns a new ThemeSpacing instance by copying the current one and applying the specified overrides.

    Only the parameters you pass will be changed; others retain their original values.

    Declaration

    Swift

    func copy(
      xs: CGFloat? = nil,
      sm: CGFloat? = nil,
      md: CGFloat? = nil,
      lg: CGFloat? = nil,
      xl: CGFloat? = nil,
      xxl: CGFloat? = nil
    ) -> ThemeSpacing

    Parameters

    xs

    Optional override for extra-small spacing.

    sm

    Optional override for small spacing.

    md

    Optional override for medium spacing.

    lg

    Optional override for large spacing.

    xl

    Optional override for extra-large spacing.

    xxl

    Optional override for double-extra-large spacing.

    Return Value

    A new ThemeSpacing instance with the applied overrides.