Skip to content

SUButton: How to properly configure Dynamic Type support? #106

@lhr000lhr

Description

@lhr000lhr

Question: Dynamic Type Support for SUButton

Hi! I'm using ComponentsKit in my iOS app and trying to ensure that SUButton properly supports Dynamic Type (Accessibility font sizes).

Current Implementation

I'm currently using SUButton like this:

@State private var model = ButtonVM {
    $0.title = "Button Title"
}

SUButton(model: self.model)
    .accessibilityLabel("Dynamic Type Test Button")

Questions

  1. Is SUButton supposed to automatically support Dynamic Type?

    • Should it respond to system font size changes without additional configuration?
  2. What's the proper way to configure Dynamic Type support for SUButton?

    • Are there specific properties in ButtonVM that need to be set?
    • Should I use .environment(\.sizeCategory, sizeCategory) modifier?
  3. Font Configuration:

    • What's the difference between font and textStyle properties in ButtonVM?
    • Which one should I use for Dynamic Type support?
  4. Testing Dynamic Type:

    • How can I verify that SUButton is properly responding to Dynamic Type changes?
    • Are there any specific accessibility considerations I should be aware of?

Environment

  • ComponentsKit version: 1.5.4
  • iOS target: iOS 17+
  • SwiftUI

Expected Behavior

I expect SUButton to:

  • Automatically scale its text size when the user changes their preferred font size in Settings
  • Maintain proper button proportions and layout
  • Be accessible to users with different accessibility needs

Current Behavior

I'm not sure if the button is properly responding to Dynamic Type changes, and I'd like to confirm the correct configuration approach.

Additional Context

I'm building a healthcare app where accessibility is crucial, so proper Dynamic Type support is important for our users.


Thank you for your help! ��

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions