# @salmonui/notifications/message API reference

> 5 exported symbols of @salmonui/notifications/message: 1 function, 2 interfaces and 2 types.

Canonical: https://salmonui.dev/docs/reference/notifications/message

```ts
import { … } from '@salmonui/notifications/message';
```

## Functions

### Message

Kind: function

Page: https://salmonui.dev/docs/reference/notifications/message/Message

```ts
function Message(props: MessageProps): ReactElement;
```

Message. Styling hooks: `.salmon-message` with `data-tone`,
`data-variant`, `data-align`; parts `.salmon-message-icon`, `-body` (the
title and the children), `-title`, `-action`, `-dismiss`; `.salmon-message-live` is the
live region wrapper. To fit the 0.75 KB budget a `data-*` hook is written
only when its prop is set; the stylesheet applies the defaults.

## Interfaces

### MessageLocaleText

Kind: interface

Page: https://salmonui.dev/docs/reference/notifications/message/MessageLocaleText

```ts
interface MessageLocaleText {
    dismiss: string;
}
```

Strings of `Message`.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `dismiss` | `dismiss: string;` |  | Accessible name of the close button. Default `"Dismiss"`. |

### MessageProps

Kind: interface

Page: https://salmonui.dev/docs/reference/notifications/message/MessageProps

```ts
interface MessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
    children?: ReactNode;
    tone?: MessageTone | undefined;
    variant?: MessageVariant | undefined;
    title?: ReactNode;
    icon?: ReactNode | false;
    action?: ReactNode;
    onDismiss?: ((event: MouseEvent<HTMLButtonElement>) => void) | undefined;
    hidden?: boolean | undefined;
    align?: 'start' | 'center' | 'end' | undefined;
    live?: 'polite' | 'assertive' | false | undefined;
    localeText?: Partial<MessageLocaleText> | undefined;
    ref?: Ref<HTMLDivElement> | undefined;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `children?: ReactNode;` | optional | The message content. |
| `tone` | `tone?: MessageTone \| undefined;` | optional | Color role. Default `'neutral'`. |
| `variant` | `variant?: MessageVariant \| undefined;` | optional | Visual weight. Default `'soft'`. |
| `title` | `title?: ReactNode;` | optional | Heading line above the content. |
| `icon` | `icon?: ReactNode \| false;` | optional | Replaces the built-in tone icon; `false` hides it. Always decorative. |
| `action` | `action?: ReactNode;` | optional | Actions after the content, usually a `Button`. |
| `onDismiss` | `onDismiss?: ((event: MouseEvent<HTMLButtonElement>) => void) \| undefined;` | optional | Shows the close button; the application then hides or unmounts the message. |
| `hidden` | `hidden?: boolean \| undefined;` | optional | Hides the message; with `live` the live region stays mounted. |
| `align` | `align?: 'start' \| 'center' \| 'end' \| undefined;` | optional | Inline alignment of the content. Default `'start'`. |
| `live` | `live?: 'polite' \| 'assertive' \| false \| undefined;` | optional | Announce the message: `'polite'` renders it in a `role="status"` region, `'assertive'` in `role="alert"`. Default `false`: static page content, not announced on load. |
| `localeText` | `localeText?: Partial<MessageLocaleText> \| undefined;` | optional | Overrides of the built-in strings. |
| `ref` | `ref?: Ref<HTMLDivElement> \| undefined;` | optional | The message element. |

## Types

### MessageTone

Kind: type

Page: https://salmonui.dev/docs/reference/notifications/message/MessageTone

```ts
type MessageTone = 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
```

Color role: the neutral scale plus the five theme seeds.

### MessageVariant

Kind: type

Page: https://salmonui.dev/docs/reference/notifications/message/MessageVariant

```ts
type MessageVariant = 'soft' | 'outline' | 'solid';
```

Visual weight.
