Socket
Socket
Sign inDemoInstall

@emotion/provider

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/provider

A provider component to provide options to emotion and allow theming


Version published
Weekly downloads
14K
increased by8.46%
Maintainers
2
Weekly downloads
 
Created
Source

@emotion/provider

A React component to provide a theme to child components

Install

yarn add @emotion/provider

Usage

/** @jsx jsx */
import { jsx } from '@emotion/jsx'
import styled from '@emotion/styled'
import * as React from 'react'
import ThemeProvider from '@emotion/provider'

let SomeParagraph = styled.p`
  color: ${props => props.theme.primaryColor};
`

class SomeComponent extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      theme: {
        primaryColor: 'hotpink'
      }
    }
  }
  render() {
    return (
      <ThemeProvider theme={this.state.theme}>
        <h1 css={theme => ({ color: theme.primaryColor })}>some heading</h1>
        <SomeParagraph>some text</SomeParagraph>
      </ThemeProvider>
    )
  }
}

FAQs

Package last updated on 04 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc