Use the inline messages when an element requires attention. They alert users that important information is available or action is required and disappear once the user has taken appropriate action.
The inline message uses an icon as the main element to give a visual indicator of the type and urgency of the message. The icon can be combined with an optional label to highlight its message.
The inline message reveals a dialog that provides a summary of the issue and links to information or actions when the user hovers on the icon or the icon and label combination.
Usage
import { InlineMessage } from 'nr1'
Examples
Types
<Stack> <StackItem> <InlineMessage label="We have updated the data for this chart." /> </StackItem> <StackItem> <InlineMessage type={InlineMessage.TYPE.SUCCESS} label="The entity has been successfully created" /> </StackItem> <StackItem> <InlineMessage type={InlineMessage.TYPE.WARNING} label="The edition is restricted for this account." /> </StackItem> <StackItem> <InlineMessage type={InlineMessage.TYPE.CRITICAL} label="We couldn't fetch the data." /> </StackItem></Stack>
Label and action
<InlineMessage type={InlineMessage.TYPE.CRITICAL} label="We couldn't transform the query." action={{ label: 'See the documentation', onClick: console.log }}/>
Dialog with details
<InlineMessage type={InlineMessage.TYPE.SUCCESS} label="The data has been added." description="You have successfully added 3 new hosts." action={{ label: 'See the hosts', onClick: console.log }}/>
Icon only
<InlineMessage type={InlineMessage.TYPE.CRITICAL} title="We can't render this query." description="We tried to transform your query into a query that is compatible with both Metric and previous Infrastructure methods, but some expressions weren’t available." action={{ label: 'See NRQL documentation', to: '//docs.newrelic.com' }}/>
Props
shape | You may specify an action to provide the user with some actionable next steps to avoid leading them to a dead end. shape
string
REQUIREDstring
functionCallback fired any time the user clicks on the button. function (
shape|stringLocation object or url string to link to. shapepathname REQUIREDstring
string
string |
string | Provide a label for screen readers to describe the status message. This is only required if the screen reader label should be different to the |
string | Appends class names to the component.Should be used only for positioning and spacing purposes. |
string | Should be used to provide further details in the dialog and complement the title.Note: |
string | Short summary of the status. Use the label when possible to shortly describe the status of the component and when there are no spacing limitations.Note: |
object | Inline style for custom styling.Should be used only for positioning and spacing purposes. |
string | Adds a Note: You might not see |
string | Title displayed in the dialog.Note: |
enum | Type can be:
|