šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@pando-styles/nirvana

Package Overview
Dependencies
Maintainers
3
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pando-styles/nirvana

> v1.3.4

1.3.8
latest
npm
Version published
Maintainers
3
Created
Source

Pando Nirvana

v1.3.4

We created a storybook to showcase components about how they look and work in our future projects. Also, these components are atomic components that are reusable across different projects that we will be creating soon.

How to start storybook

yarn storybook

Import Pando Nirvana to an existing project

yarn add @pando-styles/nirvana

or

npm install @pando-styles/nirvana

Import ThemeProvider from styled-components to your top level component.

// Parent Component or Top Level Component
import { ThemeProvider } from 'styled-components'
import { Themes } from '@pando-styles/nirvana'

const App: React.FC = () => (
  /*
   * Add logic here to toggle between themes
   * Note: Themes still have temporary values
   */

  <ThemeProvider theme={Themes.base | darkMode}>
    <div></div>
  </ThemeProvider>
)

Importing Atomic Components from Pando Nirvana

// Sample Component
import { Button } from '@pando-styles/nirvana'

const SampleComponent: React.FC = () => (
    <div>
      <Button label='Submit'>
    </div>
)

Accessing the global theme from styled-components inside a react component

// Sample Component
import { useTheme } from 'styled-components'
import { ThemeDefinition } from '@pando-styles/nirvana'

const SampleComponent: React.FC = () => {
  // or destruct what you only need
  const theme = useTheme() as ThemeDefinition

  return (
    // inline style is only a sample, will not use in development
    <div style={{ background: theme.bgColors.container}}>
      <Button label='Submit'>
    </div>
  )
}

Accessing the global theme inside a styled component

// Sample Component
import { SampleComponentProps } from './types'
import { ThemeProvider } from '@pando-styles/nirvana'

type SampleComponentTypeDef = ThemeProvider & SampleComponentProps

export const StyledSampleComponent = styled.p<SampleComponentTypeDef>`
  color: ${({ theme }) => theme.colors.primary.DEFAULT};
`

This documentation is still in progress.

FAQs

Package last updated on 27 Sep 2023

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