Section message
A section message is used to alert users to a particular section of the screen.Installation
| Install | yarn add @atlaskit/section-message |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/section-message, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
SectionMessage props
Props
| Description | Actions for the user to take after reading the section message. Accepts a ReactElement or an array of one or more SectionMessageAction React elements, which are applied as link buttons. Middle dots are automatically added between multiple link buttons, so no elements should be present between multiple actions. In general, avoid using more than two actions. |
|---|---|
| Type | ReactElement<any, string | JSXElementConstructor<any>> | ReactElement<SectionMessageActionProps, string | JSXElementConstructor<...>>[] |
| Description | The appearance styling to use for the section message. |
|---|---|
| Type | "information" | "warning" | "error" | "success" | "discovery" |
| Description | The main content of the section message. This accepts a react node, although we recommend that this should be a paragraph. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | Allows the section message's Allows the section message's |
|---|---|
| Type | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" |
| Description | An Icon component to be rendered instead of the default icon for the component.
This should only be an |
|---|---|
| Type | "symbol" | "object" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "title" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | ... 156 more ... | ComponentType<...> |
| Description | Displays a dismiss button, that allows the user to dismiss the message. It will be removed from the DOM immediately and will not be re-rendered. It does not handle persistence of the dismissed state across page reloads or remounts. |
|---|---|
| Type | boolean |
| Description | A callback function that is called when the user dismisses the message. |
|---|---|
| Type | () => void |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | Ref<HTMLElement> |
| Description | A |
|---|---|
| Type | string |
| Description | The heading of the section message. The heading of the section message. |
|---|---|
| Type | string |
SectionMessageAction props
| Description | The text that needs to be displayed for section message action. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | The URL that the rendered link button will point to. |
|---|---|
| Type | string |
| Description | A custom link component. This prop is designed to allow a custom link component to be passed to the rendered link button. The intended use-case is for when a custom router component such as react router is being used within the application. This component will only be used if a href prop is passed. |
|---|---|
| Type | ComponentClass<any, any> | FunctionComponent<any> |
| Description | Click handler which will be attached to the rendered link button. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details. |
|---|---|
| Type | (e: MouseEvent<HTMLElement, globalThis.MouseEvent>, analyticsEvent: UIAnalyticsEvent) => void |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLElement) => void) | RefObject<HTMLElement> |
| Description | The target attribute of the link. This is only used if the href prop is passed. |
|---|---|
| Type | string |
| Description | A |
|---|---|
| Type | string |