@materialios/contexts

0.1.15 • Public • Published

@materialios/contexts

ReactJs contexts for @materialios

Features

  • ResponsiveContext, { ResponsiveContextProvider }
  • DrawerContext, { DrawerContextProvider }

Installation

npm i @materialios/contexts

Example

import { useContext } from 'react'
import { ResponsiveContext, ResponsiveContextProvider } from '@materialios/contexts'

const Home = () => {
  const { orientation, device, size } = useContext(ResponsiveContext)

  return (
    <div className='Home'>
      <p>orientation: {orientation}</p>
      <p>device: {device}</p>
      <p>size: {size}</p>
    </div>
  )
}

const App = () => {
  return (
    <div className='App'>
      <ResponsiveContextProvider>
        <Home />
      </ResponsiveContextProvider>
    </div>
  )
}

export default App

Contributing

It's really still early days. So, help us to grow faster. Email me on muhammadnurrendra@gmail.com

Creator

@mnrendra

Package Sidebar

Install

npm i @materialios/contexts

Weekly Downloads

0

Version

0.1.15

License

ISC

Unpacked Size

4.05 kB

Total Files

7

Last publish

Collaborators

  • mnrendra