@theme-ui/core
[![Minified Size on Bundlephobia](https://badgen.net/bundlephobia/minzip/@theme-ui/core)](https://bundlephobia.com/package/@theme-ui/core)
Last updated 2 years ago by hasparus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @theme-ui/core 
SYNC missed versions from official npm registry.

@theme-ui/core

Minified Size on Bundlephobia

@theme-ui/core provides minimal React support for lightweight usage.

npm i @theme-ui/core @emotion/react

Usage

/** @jsxImportSource @theme-ui/core */

import { ThemeProvider } from '@theme-ui/core'

export function App() {
  return (
    <ThemeProvider theme={{ colors: { primary: '#33e' } }}>
      <h1 sx={{ color: 'primary' }}>Hello</h1>
    </ThemeProvider>
  )
}

If you already use theme-ui package, the batteries-included version of Theme UI, you don't need to install @theme-ui/core separately — it's already in your node_modules, and theme-ui reexports everything from it.

API

  • jsx — JSX function to create React elements supporting sx prop
  • ThemeProvider — a context provider
  • useThemeUI — a hook to access your theme
  • merge — an utility function to deeply merge themes together

Note that @theme-ui/core doesn’t add global or root styles to <html>/<body>. Refer to the Global Styles docs for how to add global styles.

JSX Runtime

As @theme-ui/core defines jsx function and types for it, you can use it to configure JSX runtime without installing theme-ui package.

Entry point /jsx-runtime

  • jsx
  • jsxs

Entry point /jsx-dev-runtime

  • jsxDEV

Current Tags

  • 0.16.2-scale-tuples.0                                ...           canary (3 years ago)
  • 0.17.2-develop.1                                ...           develop (2 years ago)
  • 0.4.0-highlight.0                                ...           highlight (7 years ago)
  • 0.17.4                                ...           latest (a year ago)
  • 0.6.0-alpha.8                                ...           next (6 years ago)

431 Versions

Downloads
Total 596
Today 29
This Week 41
This Month 589
Last Day 8
Last Week 240
Last Month 3
Dependencies (2)
Dev Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE