Skip to content

odigos-io/ui-theme

Repository files navigation

Odigos UI Theme

This library contains the base theme for all Odigos UI libraries (ui-icons, ui-components, ui-containers).

Installation

Using npm:

npm i @odigos/ui-theme

Using yarn:

yarn add @odigos/ui-theme

Usage

Wrap your app with the theme provider:

import Theme from '@odigos/ui-theme'

const AppProviders = () => {
  return (
    <Theme.Provider>
      <App />
    </Theme.Provider>
  )
}

You can then access one of: useTheme, useDarkMode, ToggleDarkMode, animations, opacity, and styled (styled-components) from the Theme object:

import Theme from '@odigos/ui-theme'

const App = () => {
  const { darkMode } = Theme.useDarkMode()

  return (
    <div>
      {darkMode ? 'it is dark in here' : 'it is light in here'}
      <Theme.ToggleDarkMode />
    </div>
  )
}