Usage
import { SectionMessage } from 'nr1'
Examples
Props
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
Callback fired any time the user clicks on the button.
function (event: React.MouseEvent )
Location object or url string to link to.
shape
Appends class names to the component.
Should be used only for positioning and spacing purposes.
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.
Inline style for custom styling.
Should be used only for positioning and spacing purposes.
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.
Use it to provide the main message.
Note: title
and description
props are optional, but at least one
of them has to be provided.
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 ofSectionMessage.TYPE.CRITICAL,SectionMessage.TYPE.INFO,SectionMessage.TYPE.SUCCESS,SectionMessage.TYPE.WARNING,>