• Log inStart now

SectionMessage

Usage

import { SectionMessage } from 'nr1'

Examples

Props

actionsshape[]

You may use up to two actions to help the user navigate to another view, trigger background events, or change the nerdlet/section behavior.

shape

ariaLabelstring
labelrequiredstring
onClickfunction

Callback fired any time the user clicks on the button.

function (
event: React.MouseEvent
)
toshape|string

Location object or url string to link to.

shape

pathnamerequiredstring
searchstring
hashstring
classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

descriptionstring

Use it to provide further details and explain, if any, the steps for the user to take.

Note: title and description props are optional, but at least one of them has to be provided.

styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id attribute. Use it to target the component in unit and E2E tests.

For a test id to be valid, prefix it with your nerdpack id, followed up by a dot.

For example, my-nerdpack.some-element.

Note: You might not see data-test-id attributes as they are removed from the DOM, to debug them pass a e2e-test query parameter to the URL.

titlestring

Use it to provide the main message.

Note: title and description props are optional, but at least one of them has to be provided.

typeenum
DEFAULT
SectionMessage.TYPE.INFO

Type can be:

  • Info (default) - Use it to indicate that an something is new, that an item has just been created, or to provide help.

  • Success - Use it to communicate positive changes or conditions.

  • Warning - Use it to communicate a possible problem, undesired situation, cautionary advice, or advanced notice of some sort.

  • Critical - Use it to communicate a problem.

<One of
SectionMessage.TYPE.CRITICAL,
SectionMessage.TYPE.INFO,
SectionMessage.TYPE.SUCCESS,
SectionMessage.TYPE.WARNING,
>
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.