# @types/styled-theming

> TypeScript definitions for styled-theming

Latest version **2.2.9** (published 2025-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/styled-theming
pnpm add @types/styled-theming
yarn add @types/styled-theming
bun add @types/styled-theming
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.2.9 |
| Published | 2025-11-18 |
| First published | 2018-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/styled-theming
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styled-theming
- npm.io page: https://npm.io/package/@types/styled-theming

## Dependencies (2)

- [csstype](https://npm.io/package/csstype.md) ^3.2.2
- [@types/styled-components](https://npm.io/package/@types/styled-components.md) *

## Recent versions

- 2.2.9 (latest) — 2025-11-18
- 2.2.8 (ts5.1) — 2023-11-07
- 2.2.5 (ts3.9) — 2020-07-31
- 2.2.2 (ts2.9) — 2019-06-27
- 2.2.0 (ts2.7) — 2018-11-02
- 2.2.7 — 2023-10-18
- 2.2.6 — 2023-09-25
- 2.2.4 — 2020-06-25
- 2.2.3 — 2020-05-15
- 2.2.1 — 2019-04-12

## README

# Installation
> `npm install --save @types/styled-theming`

# Summary
This package contains type definitions for styled-theming (https://github.com/styled-components/styled-theming#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styled-theming.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styled-theming/index.d.ts)
````ts
import { FlattenInterpolation, ThemedStyledProps, ThemeProps } from "styled-components";

declare function theme(name: string, values: theme.ThemeMap): theme.ThemeSet;

declare namespace theme {
    type ThemeValueResult =
        | string
        | FlattenInterpolation<ThemeProps<any>>
        | FlattenInterpolation<ThemedStyledProps<any, any>>;
    type ThemeValueFn = (props: object) => ThemeValueResult;
    type ThemeValue = ThemeValueFn | ThemeValueResult;

    interface ThemeMap {
        [key: string]: ThemeValue;
    }

    type VariantMap<TVariant extends string> = {
        [key in TVariant]: ThemeMap;
    };

    type ThemeSet = (props: object) => string;
    type VariantSet<TProp extends string, TVariant extends string> = (props: { [key in TProp]?: TVariant }) => string;

    function variants<TProp extends string, TVariant extends string>(
        name: string,
        prop: TProp,
        values: VariantMap<TVariant>,
    ): VariantSet<TProp, TVariant>;
}

export = theme;

````

### Additional Details
 * Last updated: Tue, 18 Nov 2025 02:14:41 GMT
 * Dependencies: [@types/styled-components](https://npmjs.com/package/@types/styled-components), [csstype](https://npmjs.com/package/csstype)

# Credits
These definitions were written by [Arjan Jassal](https://github.com/ArjanJ), [Hieu Ho](https://github.com/hieuhlc), and [David Daniell](https://github.com/tinynumbers).

---
_Source: https://npm.io/package/@types/styled-theming · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
