2.0.0-rc.4 • Published 9 months ago

@asphalt-react/theme-provider v2.0.0-rc.4

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
9 months ago

ThemeProvider

npm

ThemeProvider allows you to theme your app. You can even nest ThemeProviders to apply a theme on just a section of your app as well.

⚠️ ThemeProvider only works in secure contexts

Usage

import ThemeProvider from "@asphalt-react/theme-provider"
import { Button } from "@asphalt-react/button"

const customTheme = {
  // your theme tokens
}

function App() {
  return (
    <ThemeProvider theme={customTheme}>
      <Button>Click me</Button>
    </ThemeProvider>
  )
} 

Props

children

React node or node tree to apply theme to.

typerequireddefault
nodetrueN/A

theme

Asphalt Theme object.

typerequireddefault
objectfalselegacyVariables

as

Html element/React component to render as container.

typerequireddefault
elementTypefalse"div"