useUiCapsContext

Use this hook to access the UI-Caps context.

Usage

import { useUiCapsContext } from '@binarycapsule/ui-capsules';

const App = () => {
  const { theme, isDarkTheme, setTheme } = useUiCapsContext();

  return (
    <main>
      ...   
    </main>
  );
};

Return value

NameDescription
theme
Theme
The current theme (light or dark).
isDarkTheme
boolean
Whether or not the dark theme is currently set.
setTheme
(theme: 'light' | 'dark') => void
Function to set the current theme.