No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Message

A message is an element that displays a brief, important message in a way that attracts the user's attention without interrupting the user's task.

usage
import { Message, Content } from "@sharegate/orbit-ui";
sources
Github

Guidelines

When to use

  • To provide feedback such as success, warning, error etc.
  • To confirm an action.
  • To incite the user to take an action, if this action does not require to interrupt the user flow.

Content

  • Be short. Limit your content to one sentence when possible.
  • Provide a path of action. Don't let the user wonder what's next.
  • Use copy that is easily scannable.
  • Link to the appropriate documentation when additional context is needed.

Accessibility

  • Text should be descriptive and complete enough to be understood without relying on the icon. Using an icon to carry information will make it non-accessible.

Message vs Alert

  • If the user flow has to be interrupted, use an alert.

Usage

Default

A default message.

We offer the safest space travel of the industry!
Editable example

Rich content

A message can also accept rich content.

Travel with us!
We offer the safest space travel of the industry. Consult our safety policy here.
Editable example

Action

A message can accept an action button.

We offer the safest space travel of the industry!
Editable example

Dismissable

A message can be dismissable by specifying an onDismiss handler.

We offer the safest space travel of the industry!
Editable example

Informative

Use an informative message to notify a user of a change that's relevant for them to achieve their current goal.

We offer the safest space travel of the industry!
Editable example

Warning

Use the warning variant message to help a user avoid an issue.

Editable example

Positive

Use the positive variant to inform a user that an action has completed successfuly.

Your email to booking@spacetravel.com has been sent!
Editable example

Negative

Use the negative variant to help a user understand a critical issue at the system level.

Editable example

Controlled

A message can handle show state in controlled mode.

We offer the safest space travel of the industry!
Editable example

Props

Message

usage
import { Message } from "@sharegate/orbit-ui";
slots
"content", "button"
NameDescriptionDefault
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
onDismiss
Called when the dismiss button is clicked.
(event: MouseEvent<Element, MouseEvent>) => void
eventReact's original synthetic event.
-
show
A controlled show value.
falsetrue
true
variant
The style to use.
"informative""warning""positive""negative"
"informative"

Content

usage
import { Content } from "@sharegate/orbit-ui";
NameDescriptionDefault
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
slot
Slot to render into.
string
-