Skip to content

feat(surveys/react-native): Support custom fontFamily in survey appearance #2959

@adboio

Description

@adboio

Summary

The React Native SDK has built-in survey UI but doesn't apply the fontFamily from survey appearance settings.

Current State

  • Survey appearance includes fontFamily in the data model
  • Built-in survey components use hardcoded font styles
  • fontFamily is not passed to TextStyle in any components

Expected Behavior

When a survey is configured with a custom fontFamily, the built-in survey UI should apply that font (if available/bundled in the app), falling back to system default if not found.

Reference Implementation

See posthog-ios SurveySheet.swift:

static func customFont(family: String) -> Font? {
    if let uiFont = UIFont(name: family, size: UIFont.systemFontSize) {
        return Font(uiFont)
    }
    return nil  // Falls back to system default
}

Implementation Notes

  • Pass fontFamily to TextStyle in survey components
  • Font must be bundled with the app to work
  • Fall back to system default if font not found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions