API reference: @salmonui/notifications/message
MessagePropsinterface
import type { MessageProps } from '@salmonui/notifications/message';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;
}
| Name | Signature | Description |
|---|---|---|
childrenoptional | children?: ReactNode; | The message content. |
toneoptional | tone?: MessageTone | undefined; | Color role. Default |
variantoptional | variant?: MessageVariant | undefined; | Visual weight. Default |
titleoptional | title?: ReactNode; | Heading line above the content. |
iconoptional | icon?: ReactNode | false; | Replaces the built-in tone icon; |
actionoptional | action?: ReactNode; | Actions after the content, usually a |
onDismissoptional | onDismiss?: ((event: MouseEvent<HTMLButtonElement>) => void) | undefined; | Shows the close button; the application then hides or unmounts the message. |
hiddenoptional | hidden?: boolean | undefined; | Hides the message; with |
alignoptional | align?: 'start' | 'center' | 'end' | undefined; | Inline alignment of the content. Default |
liveoptional | live?: 'polite' | 'assertive' | false | undefined; | Announce the message: |
localeTextoptional | localeText?: Partial<MessageLocaleText> | undefined; | Overrides of the built-in strings. |
refoptional | ref?: Ref<HTMLDivElement> | undefined; | The message element. |