2.0.0-rc.4 • Published 9 months ago
@asphalt-react/theme-provider v2.0.0-rc.4
ThemeProvider
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.
type | required | default |
---|---|---|
node | true | N/A |
theme
Asphalt Theme object.
type | required | default |
---|---|---|
object | false | legacyVariables |
as
Html element/React component to render as container.
type | required | default |
---|---|---|
elementType | false | "div" |
2.0.0-rc.4
9 months ago
2.0.0-rc.0
12 months ago
2.0.0-alpha.28
2 years ago
2.0.0-alpha.19
2 years ago
2.0.0-alpha.16
2 years ago
1.22.0
2 years ago
2.0.0-alpha.13
2 years ago
2.0.0-alpha.8
3 years ago
1.17.0
3 years ago
2.0.0-alpha.4
3 years ago
2.0.0-alpha.6
3 years ago
1.16.0
3 years ago
2.0.0-alpha.7
3 years ago
2.0.0-alpha.3
3 years ago
1.14.1
3 years ago
2.0.0-alpha.2
3 years ago
2.0.0-alpha.1
3 years ago
1.13.0
3 years ago