Inline Alert
An alert displays a short, important message in a way that attracts the user’s attention without interrupting the user’s task. It is used to provide feedback to the user about an operation or to notify the user about something important.
import {QInlineAlert} from "@qui/react"
Examples
Showcase
The default style variant is neutral
, and the dismissable
property determines whether the close icon is rendered.
Note
import {ReactNode} from "react"import {Plus, XSquare} from "lucide-react"import {QButton, QInlineAlert, useNotification} from "@qui/react"export default function Showcase(): ReactNode {const {notify} = useNotification()return (<div className="grid justify-center"><QInlineAlertdescription="All Major credit cards are acceptable for purchase"dismissableiconButtonProps={{onClick: () => {notify({notification: {color: "negative",icon: XSquare,label: (<span><span>Dismissed Triggered</span></span>),},})},}}label="Note"><QButton color="primary" size="s" startIcon={Plus} variant="fill">Action</QButton></QInlineAlert></div>)}
Colors
There are 5 status colors available, configurable via the color
input.
Payment Options
Payment Options
Payment Options
Payment Options
Payment Options
import {ReactNode} from "react"import {QInlineAlert} from "@qui/react"export default function Status(): ReactNode {return (<div className="grid justify-center"><div className="flex w-[460px] flex-col gap-8"><QInlineAlertdescription="Enter your billing address and payment method to complete your purchase."label="Payment Options"/><QInlineAlertcolor="informative"description="Enter your billing address and payment method to complete your purchase."label="Payment Options"/><QInlineAlertcolor="positive"description="Enter your billing address and payment method to complete your purchase."label="Payment Options"/><QInlineAlertcolor="warning"description="Enter your billing address and payment method to complete your purchase."label="Payment Options"/><QInlineAlertcolor="negative"description="Enter your billing address and payment method to complete your purchase."label="Payment Options"/></div></div>)}
API
Props
Name & Description | Option(s) | Default |
---|---|---|
Label text – the alert's primary message. | ReactNode | |
The component used for the root node. It can be a React component or
element. |
| 'div' |
Content of the Alert. | ReactNode | |
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element. |
| |
The style variant of the alert. |
| "neutral" |
Optional description text shown below the label. | ReactNode | |
Render a close icon that dismisses the alert when clicked. |
| false |
lucide-angular icon. If supplied, this will override the icon from the variant
input. Refer to the above snippets for examples. |
| |
Props passed to the Dismiss Icon when dismissable is true . |
| {} |
The style global attribute
contains CSS styling
declarations to be applied to the element. | CSSProperties | |
Deprecated since v0.5.0, use color instead |
| |
If true, surround the description text in the Wrap Balancer component. |
| false |
Type
| ElementType| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or
element.
Type
string
Description
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element.
Type
| 'neutral'| 'informative'| 'positive'| 'warning'| 'negative'
Default
"neutral"
Description
The style variant of the alert.
Type
ReactNode
Description
Optional description text shown below the label.
Type
boolean
Default
false
Description
Render a close icon that dismisses the alert when clicked.
Type
| LucideIcon| ReactNode
Description
lucide-angular icon. If supplied, this will override the icon from the variant
input. Refer to the above snippets for examples.
Type
Partial<QIconButtonProps>
Default
{}
Description
Props passed to the Dismiss Icon when dismissable is
true
.Type
CSSProperties
Description
The style global attribute
contains CSS styling
declarations to be applied to the element.
Type
| 'neutral'| 'informative'| 'positive'| 'warning'| 'negative'
Description
Deprecated since v0.5.0, use color instead
Related symbols
Type
boolean
Default
false
Description
If true, surround the description text in the Wrap Balancer component.