# @fluentui-react-native/theme

> Experimental version of fluentui-react-native theme framework

Latest version **0.14.12** (published 2026-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fluentui-react-native/theme
pnpm add @fluentui-react-native/theme
yarn add @fluentui-react-native/theme
bun add @fluentui-react-native/theme
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.14.12 |
| Published | 2026-11-11 |
| First published | 2020-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 75.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1449 |
| Maintainers | jasonvmorse, acoates, uifrnbot, hansenyy, microsoft1es |

## Links

- npm: https://www.npmjs.com/package/@fluentui-react-native/theme
- Repository: https://github.com/microsoft/fluentui-react-native
- Homepage: https://github.com/microsoft/fluentui-react-native#readme
- Issues: https://github.com/microsoft/fluentui-react-native/issues
- npm.io page: https://npm.io/package/@fluentui-react-native/theme

## Dependencies (1)

- [@fluentui-react-native/design](https://npm.io/package/@fluentui-react-native/design.md) 0.6.1

## Recent versions

- 0.14.12 (latest) — 2026-11-11
- 0.14.11 — 2026-11-07
- 0.14.10 — 2026-11-02
- 0.14.9 — 2026-10-28
- 0.14.8 — 2026-09-23
- 0.14.7 — 2026-09-22
- 0.14.6 — 2026-09-03
- 0.14.5 — 2026-09-02
- 0.14.2 — 2026-08-20
- 0.14.0 — 2026-08-06
- 0.13.1 — 2026-06-25
- 0.13.0 — 2026-06-17
- 0.12.3 — 2026-04-24
- 0.12.1 — 2026-03-03
- 0.12.0 — 2026-02-24
- … 104 more at https://npm.io/package/@fluentui-react-native/theme/versions

## README

# @fluentui-react-native/theme

This package is a compatibility shim. The theme framework — the `ThemeReference` class and the `ThemeProvider` implementation — now lives in `@fluentui-react-native/design` and is exposed via its `@fluentui-react-native/design/theming` submodule. This package re-exports them so the existing `@fluentui-react-native/theme` entry point keeps working; new code should import from `@fluentui-react-native/design/theming`.

## `ThemeReference`

A class that constructs a `Theme` based upon a either another fully built `Theme` or a parent `ThemeReference`, then layers in `PartialTheme` fragments, or `ThemeTransform` functions. It then provides the ability to invalidate, the ability to update the fragments, and the ability to listen to changes for the theme.

### Creating a `ThemeReference`

A reference is created by combination a base with zero or more recipes.

- **Base** - either a `Theme` or another `ThemeReference`
- **Recipe** - either a `PartialTheme` or a function of the form `(parent: Theme) => PartialTheme`

The `ThemeReference` supports the following methods:

- **`theme`** - get the built theme, implemented as a getter to dynamically create it when queried
- **`invalidate()`** - let the reference know something has changed, this will replay the recipies to generate a new theme
- **`update(...recipes)`** - update the recipes used to build the theme, will also invalidate the reference
- **`addOnThemeChanged(listener)`** - add a listener to be notified of theme changes
- **`removeOnThemeChanged(listener)`** - remove the listener

In practice this can be used to implement a theme, that has some values coming from external calls (maybe to a native module), and rebuilds itself when those values change. This might look something like:

```ts
import { defaultFluentTheme } from '@fluentui-react-native/default-theme';
import { ThemeReference } from '@fluentui-react-native/design/theming';

// in this case wrapping the reference in a function makes it easy to encapsulate the invalidating
export const createMyCustomTheme = () => {
  // create the reference
  const themeRef = new ThemeReference(
    // base it on the default fluent theme
    defaultFluentTheme,
    // mix in some constant values to override
    {
      colors: {
        // stuff here
      },
    },
    // make some outside calls to get some values
    () => {
      // query a body background from somewhere else
      const bodyBackground = checkSomeOutsideValue();
      return {
        colors: {
          bodyBackground,
        },
      };
    },
  );
  // register a change handler that invalidates the reference
  listenForOutsideValueChange(() => {
    themeRef.invalidate();
  });
  return themeRef;
};
```

## `ThemeProvider`

This is a standard context provider that takes theme references as inputs for the theme prop.

---
_Source: https://npm.io/package/@fluentui-react-native/theme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
