Skip to content
Theme UI
GitHub
  • Getting Started
  • Theming
  • The sx Prop
  • Styling MDX
  • Color Modes
  • Themed
  • MDX Components
  • Hooks
  • API
  • Theme Specification
  • Customize
  • Demo
  • Resources
  • Components
  • Packages
  • Guides
    • How it Works
    • JSX Pragma
    • Motivation
    • Object Styles
    • Variants
    • Layouts
    • Keyframes
    • Styled Components
    • MDX Layout Components
    • Responsive Typography
    • Nested ThemeProviders
    • Custom CacheProvider
    • Syntax Highlighting
    • Theme Color Meta Tag
    • Color Mode Toggles
    • Global Styles
    • Linked Headings
    • Using without MDX
    • Merging Themes
    • TypeScript
  • Recipes
  • Migrating
  • GitHub

Theme Color Meta Tag

Use your framework’s method of adding a meta tag to <head />—react-helmet in Gatsby and next/head in Next.js, for example.

// example Head component with react-helmet
import { Helmet } from 'react-helmet'
import { useThemeUI } from 'theme-ui'
export default (props) => {
const { theme } = useThemeUI()
return (
<Helmet>
<meta name="theme-color" content={theme.colors.primary} />
</Helmet>
)
}
Edit the page on GitHub
Previous:
Syntax Highlighting
Next:
Color Mode Toggles