import * as React from 'react'; import { Stack, Link, ILinkStyleProps, ILinkStyles, PrimaryButton, ITheme, IStackProps } from 'office-ui-fabric-react'; import { Panel, PanelType } from 'office-ui-fabric-react/lib/Panel'; import { Pivot, PivotItem } from 'office-ui-fabric-react/lib/Pivot'; import { IThemeRules, ThemeGenerator } from 'office-ui-fabric-react/lib/ThemeGenerator'; import { mergeStyles } from '@uifabric/merge-styles'; import { CodepenComponent } from '@uifabric/example-app-base'; export interface IHeaderProps { themeRules?: IThemeRules; } export interface IHeaderState { showPanel: boolean; jsonTheme: string; powershellTheme: string; themeAsCode: any; } const outputPanelClassName = mergeStyles({ display: 'flex', }); const textAreaClassName = mergeStyles({ height: 350, width: '100%', marginRight: 28, backgroundColor: 'white', color: '#333', }); const microsoftLogo = mergeStyles({ width: '120px', display: 'block', }); const pipeFabricStyles = (p: ILinkStyleProps): ILinkStyles => ({ root: { textDecoration: 'none', color: p.theme.semanticColors.bodyText, fontWeight: '600', fontSize: p.theme.fonts.medium.fontSize, }, }); const headerStackStyles = (p: IStackProps, theme: ITheme) => ({ root: { backgroundColor: theme.semanticColors.bodyBackground, minHeight: 47, padding: '0 32px', boxShadow: theme.effects.elevation16, }, }); const codepenHeader = `const { createTheme, Checkbox, Customizations, DefaultButton, Fabric, loadTheme, Pivot, PivotItem, PrimaryButton, Stack, Toggle } = Fabric;\n\n`; const codepenSamples = `\n\n const Content = () => { Customizations.applySettings({ theme: myTheme }); return ( ); } ReactDOM.render(,document.getElementById('content'));`; export class Header extends React.Component { constructor(props: any) { super(props); this.state = { showPanel: false, jsonTheme: '', powershellTheme: '', themeAsCode:
, }; } public render(): JSX.Element { return ( | Fluent UI Theme Designer

This code block creates the theme you have configured above using the createTheme utility function. Calling Customizations.applySettings with this theme will automatically apply the configured theming to any Fabric controls used within the same app. You can also export this example to CodePen with a few component examples below.