Inline Notification
import {InlineNotification} from "@qualcomm-ui/react/inline-notification"Examples
Simple
Basic inline notification using the simple API with heading and description.
<InlineNotification
className="w-96"
description="Description"
dismissable
label="Label"
/>Composite
Use the composite API with individual components for more granular control.
<InlineNotification.Root className="w-96">
<InlineNotification.Icon />
<InlineNotification.Label>Label</InlineNotification.Label>
<InlineNotification.Description>
Description
</InlineNotification.Description>
</InlineNotification.Root>Emphasis (color)
Control the visual emphasis with different colors: info, success, warning, danger, and neutral. Customize these with the emphasis prop.
<InlineNotification emphasis="info" label="info" />
<InlineNotification emphasis="success" label="success" />
<InlineNotification emphasis="warning" label="warning" />
<InlineNotification emphasis="danger" label="danger" />
<InlineNotification emphasis="neutral" label="neutral" />Dismissable
Add dismiss functionality to the simple notification using the dismissable prop. Use the <InlineNotification.CloseButton /> component when using the composite API.
<InlineNotification dismissable label="Simple" />
<InlineNotification.Root>
<InlineNotification.Icon />
<InlineNotification.Label>Composite</InlineNotification.Label>
<InlineNotification.CloseButton />
</InlineNotification.Root>Action
Include action links in notifications using the action property or the <InlineNotification.Action> component via the composite API.
Layout
Choose between inline and stacked layouts using the layout property. Stacked layout places the description and action below the content.
<InlineNotification
action={<Link size="sm">Text link</Link>}
description="Description for horizontal orientation"
dismissable
label="Horizontal"
/>
<InlineNotification
action={<Link size="sm">Text link</Link>}
description="Description for vertical orientation"
dismissable
label="Vertical"
orientation="vertical"
/>API
<InlineNotificaton>
The InlineNotification component supports every property from the InlineNotification.Root component, plus the props listed below.
| Prop | Type | Default |
|---|---|---|
The component used for the content of the action element. | ||
Props applied to the action container element. | ||
Props applied to the close button element. | ||
Optional description text for the notification. | ||
Props applied to the description element. | ||
When true, renders a close button that dismisses the notification on click. | boolean | false |
| LucideIcon | ||
Props applied to the icon element. | ||
Optional heading text for the notification. | ||
Props applied to the label element. |
booleantrue, renders a close button that dismisses the notification on click.| LucideIcon
| ReactNode
Composite API
<InlineNotification.Root>
| Prop | Type | Default |
|---|---|---|
The document's text/writing direction. | 'ltr' | 'rtl' | 'ltr' |
Governs the color of the notification and its icon. | | 'info' | 'info' |
A root node to correctly resolve document in custom environments. i.e.,
Iframes, Electron. | () => | |
id attribute. If
omitted, a unique identifier will be automatically generated for accessibility. | string | |
Function invoked when the notification is dismissed | () => void | |
The layout of the notification's elements. | | 'horizontal' | 'horizontal' |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement | |
| 'status' | 'status' |
'ltr' | 'rtl'
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'neutral'
| 'loading'
() =>
| Node
| ShadowRoot
| Document
string() => void
| 'horizontal'
| 'vertical'
| ReactElement
| ((
props: object,
) => ReactElement)
<InlineNotification.Icon>
<span> element by
default.| Prop | Type |
|---|---|
| LucideIcon | |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
| LucideIcon
| ReactNode
| ReactElement
| ((
props: object,
) => ReactElement)
| Attribute / Property | Value |
|---|---|
className | 'qui-notification__icon' |
data-part | 'status-icon' |
data-scope | 'inline-notification' |
className'qui-notification__icon'data-part'status-icon'data-scope'inline-notification'<InlineNotification.Label>
<div> element by default.| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be automatically generated for accessibility. | string |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
string| ReactElement
| ((
props: object,
) => ReactElement)
| Attribute / Property | Value |
|---|---|
className | 'qui-notification__label' |
data-part | 'heading' |
data-scope | 'inline-notification' |
className'qui-notification__label'data-part'heading'data-scope'inline-notification'<InlineNotification.Description>
<div>
element by default.| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be automatically generated for accessibility. | string |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
string| ReactElement
| ((
props: object,
) => ReactElement)
| Attribute / Property | Value |
|---|---|
className | 'qui-notification__description' |
data-part | 'description' |
data-scope | 'inline-notification' |
className'qui-notification__description'data-part'description'data-scope'inline-notification'<InlineNotification.CloseButton>
<button> element by default.| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be automatically generated for accessibility. | string |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
string| ReactElement
| ((
props: object,
) => ReactElement)
| Attribute / Property | Value |
|---|---|
className | 'qui-notification__close-button' |
data-part | 'close-trigger' |
data-scope | 'inline-notification' |
className'qui-notification__close-button'data-part'close-trigger'data-scope'inline-notification'<InlineNotification.ActionContainer>
<div>
element by default.| Prop | Type |
|---|---|
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
| ReactElement
| ((
props: object,
) => ReactElement)
| Attribute / Property | Value |
|---|---|
className | 'qui-notification__action' |
data-orientation | | 'horizontal' |
data-part | 'action' |
data-scope | 'inline-notification' |
className'qui-notification__action'data-orientation| 'horizontal'
| 'vertical'
data-part'action'data-scope'inline-notification'
<div>element by default.