Skip to main content
The @theme-ui/core package provides minimal React support for lightweight usage of Theme UI. It includes the essential features for styling React components with the sx prop and accessing theme values.

Installation

When to Use

Use @theme-ui/core when you:
  • Want a minimal, lightweight version of Theme UI
  • Don’t need the full component library
  • Are building your own component library on top of Theme UI
  • Want to minimize bundle size
If you’re using the umbrella theme-ui package, you don’t need to install @theme-ui/core separately—it’s already included and re-exported.

Exports

Components

ThemeProvider

A React context provider that makes your theme available to all components.
Props:
  • theme: Theme | ((outerTheme: Theme) => Theme) - Your theme object or a function that receives the outer theme and returns a new theme
  • children: React.ReactNode - Child components

Hooks

useThemeUI

A hook to access the current theme and Theme UI context.
Returns:
  • __EMOTION_VERSION__: string - The version of Emotion being used
  • theme: Theme - The current theme object
  • colorMode: string (when using ColorModeProvider) - The current color mode
  • setColorMode: Function (when using ColorModeProvider) - Function to change color mode

Utilities

merge

Deeply merges theme objects together.
Signature:

JSX Runtime

jsx

The JSX function that creates React elements with support for the sx prop.

createElement

An alias for jsx for Babel JSX pragma support.

Entry Points

Main Entry Point

/jsx-runtime

For the new JSX transform:
Exports:
  • jsx
  • jsxs

/jsx-dev-runtime

Development version of the JSX runtime:
Exports:
  • jsxDEV

TypeScript Types

All types from @theme-ui/css are re-exported:

Notes

  • @theme-ui/core does not add global styles to <html> or <body>. For global styles, see the Global Styles guide.
  • Requires @emotion/react as a peer dependency
  • Requires React 18 or higher
  • No side effects - safe for tree-shaking