# @salmonui/core/theme API reference

> 8 exported symbols of @salmonui/core/theme: 1 component, 2 interfaces, 4 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/core/theme

```ts
import { … } from '@salmonui/core/theme';
```

## Components

### ThemeProvider

Kind: component

Page: https://salmonui.dev/docs/reference/core/theme/ThemeProvider

```ts
function ThemeProvider({ theme, children, className, style, ref }: ThemeProviderProps): import("react").JSX.Element;
```

Theme scope root: `<div class="salmon-theme-scope" data-salmon-theme="<hash>">`.
Renders no styles itself; the CSS comes from `ThemeStyle` or from the
precompiled default stylesheet. No browser APIs during render. A theme
that sets `density` also provides it to components with JavaScript
metrics (the Data Grid row height); unset inherits the enclosing scope's.

Props: [`ThemeProviderProps`](https://salmonui.dev/docs/reference/core/theme/ThemeProviderProps) (its members are the props)

## Interfaces

### SalmonThemeInput

Kind: interface

Page: https://salmonui.dev/docs/reference/core/theme/SalmonThemeInput

```ts
interface SalmonThemeInput {
    colors?: {
        primary?: SalmonHexColor;
        success?: SalmonHexColor;
        warning?: SalmonHexColor;
        danger?: SalmonHexColor;
        info?: SalmonHexColor;
    };
    colorScheme?: SalmonColorScheme | 'inherit';
    density?: SalmonDensity;
    fontFamily?: string;
    neutral?: {
        hue?: number;
        chroma?: number;
    };
    surfaces?: {
        sidebar?: SalmonSurfaceColor;
        appBar?: SalmonSurfaceColor;
        tableHeader?: SalmonSurfaceColor;
    };
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `colors` | `colors?: {     primary?: SalmonHexColor;     success?: SalmonHexColor;     warning?: SalmonHexColor;     danger?: SalmonHexColor;     info?: SalmonHexColor; };` | optional |  |
| `colorScheme` | `colorScheme?: SalmonColorScheme \| 'inherit';` | optional | `inherit` follows a `data-salmon-color-scheme` attribute set by the host on an ancestor. |
| `density` | `density?: SalmonDensity;` | optional | Control and row metrics. Unset: inherited from the enclosing scope (`'default'` at the root). |
| `fontFamily` | `fontFamily?: string;` | optional | CSS `font-family` list for `--salmon-font-sans`. Unset: inherited (the system stack at the root). |
| `neutral` | `neutral?: {     hue?: number;     chroma?: number; };` | optional | Tint of the neutral ramp: OKLCH hue in degrees (default: the primary hue) and chroma (clamped to [0, 0.04]). |
| `surfaces` | `surfaces?: {     sidebar?: SalmonSurfaceColor;     appBar?: SalmonSurfaceColor;     tableHeader?: SalmonSurfaceColor; };` | optional | Region surfaces (`[data-salmon-surface]`). Unset: inherited from the enclosing scope. |

### ThemeProviderProps

Kind: interface

Page: https://salmonui.dev/docs/reference/core/theme/ThemeProviderProps

```ts
interface ThemeProviderProps {
    theme?: SalmonThemeInput;
    children?: ReactNode;
    className?: string;
    style?: CSSProperties;
    ref?: Ref<HTMLDivElement>;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `theme` | `theme?: SalmonThemeInput;` | optional |  |
| `children` | `children?: ReactNode;` | optional |  |
| `className` | `className?: string;` | optional |  |
| `style` | `style?: CSSProperties;` | optional |  |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional |  |

## Types

### SalmonColorScheme

Kind: type

Page: https://salmonui.dev/docs/reference/core/theme/SalmonColorScheme

```ts
type SalmonColorScheme = 'light' | 'dark' | 'auto';
```

### SalmonDensity

Kind: type

Page: https://salmonui.dev/docs/reference/core/theme/SalmonDensity

```ts
type SalmonDensity = 'default' | 'compact';
```

Control and row metrics.

### SalmonHexColor

Kind: type

Page: https://salmonui.dev/docs/reference/core/theme/SalmonHexColor

```ts
type SalmonHexColor = `#${string}`;
```

Opaque CSS hex color: `#rgb` or `#rrggbb`.

### SalmonSurfaceColor

Kind: type

Page: https://salmonui.dev/docs/reference/core/theme/SalmonSurfaceColor

```ts
type SalmonSurfaceColor = SalmonHexColor | 'primary';
```

A surface seed: a hex color, or `'primary'` for the resolved primary seed.

## Constants

### defaultSalmonTheme

Kind: const

Page: https://salmonui.dev/docs/reference/core/theme/defaultSalmonTheme

```ts
const defaultSalmonTheme: {
    readonly colors: Readonly<Record<SemanticColor, SalmonHexColor>>;
    readonly colorScheme: SalmonColorScheme;
};
```
