Skip to main content

StatusMessageProps

Props for StatusMessage.

This is an interface exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { StatusMessageProps } from "@mapcairn/map";

interface StatusMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onBlur" | "onFocus" | "onMouseEnter" | "onMouseLeave" | "role">

Properties​

action​

readonly action?: {
readonly label: string;
readonly onClick: () => void;
};

An optional action, such as "Retry". It does not dismiss the message.

autoDismissMs​

readonly autoDismissMs?: number;

How long an info or success message stays before onDismiss is called. Values under 6000 are raised to 6000. Ignored for errors. Changing it after mount has no effect; remount with a key instead.

children​

readonly children: ReactNode;

The message text. Keep it short and specific.

dismissLabel​

readonly dismissLabel?: string;

The accessible name of the dismiss button. Defaults to the catalogue's "ui.dismiss".

onDismiss​

readonly onDismiss: () => void;

Called when the person dismisses the message, and when it times out.

variant​

readonly variant: StatusMessageVariant;

info and success are polite status messages; error is an alert.

See also​

Source: packages/map/src/ui/StatusMessage/StatusMessage.tsx:40