New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fluentui/react-theme-provider

Package Overview
Dependencies
Maintainers
12
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/react-theme-provider

Fluent UI React theme provider component, hook, and theme related utilities.

9.0.0-alpha.43
Source
npm
Version published
Weekly downloads
11K
-31.89%
Maintainers
12
Weekly downloads
 
Created
Source

@fluentui/react-theme-provider

React theming component and hook for Fluent UI React

Installation

yarn add @fluentui/react-theme-provider

Example usage

Use the theme with Fluent UI by wrapping content within the provider:

import { webLightTheme } from '@fluentui/react-theme';
import { ThemeProvider } from '@fluentui/react-theme-provider';

export const App = () => (
  <ThemeProvider>
    <App />
  </ThemeProvider>
);

You can also nest ThemeProviders:

import { webLightTheme, PartialTheme } from '@fluentui/react-theme';
import { ThemeProvider } from '@fluentui/react-theme-provider';

const headerTheme: PartialTheme = {
  /* your customizations */
};

export const App = () => (
  <ThemeProvider theme={webLightTheme}>
    <ThemeProvider theme={headerTheme}>
      <App />
    </ThemeProvider>

    <App />
  </ThemeProvider>
);

Accessing theme

useTheme

Theme can be accessed using useTheme hook.

import { useTheme } from '@fluentui/react-theme-provider';

const Content = () => {
  const theme = useTheme();
};

export const App = () => (
  <ThemeProvider>
    <Content />
  </ThemeProvider>
);

FAQs

Package last updated on 15 Jun 2021

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