Skip to content

Theme

The Theme component is a foundational element in the UI Kit, designed to apply fonts and styles across your application, ensuring a consistent and cohesive user experience. It harmonizes with the overarching aesthetics of the Help Scout application, maintaining a unified look and feel.

Effective Practices

When implementing the Theme component, consider the following best practices to ensure a consistent and effective application of your theme:

  • Consistency is Key: Use the Theme component at the top level of your application to maintain consistency in fonts and styles throughout the user interface.
  • Avoid Overriding: Minimize custom styling on individual components within the Theme wrapper. Overriding theme styles can lead to inconsistencies and maintenance challenges.
  • Maintenance and Updates: When updating the styling, consider the global impact on your application to avoid unexpected style changes in different components.
  • Accessibility Considerations: Ensure that any customizations to the styling adhere to accessibility standards, including sufficient contrast ratios, font sizes, and color choices.

By adhering to these practices, you can leverage the Theme component to create a cohesive and maintainable design across your application, aligning with the overall aesthetics of the Help Scout application.

Usage Guidelines

The Theme component is typically used at the top level of your application or in specific sections where different theme styles are required. It encapsulates its children, applying the fetched theme styles to them.

<Theme>{/* Child components will inherit the theme styles */}</Theme>

Props

interface ThemeProps
children ReactNode

The children to render within the Theme component.

fetchStyles ? boolean

Whether or not to fetch the app styles from Help Scout App with the JavaScript SDK .

Defaults to true