Message
Example
Section titled “Example”Import
Section titled “Import”import '@sbddesign/bui-ui/message.js'import { BuiMessageReact as BuiMessage } from '@sbddesign/bui-ui/react'<bui-message mood="success" text="₿1,000 received."></bui-message><bui-message mood="caution" text="Transaction is pending."></bui-message><bui-message mood="danger" text="An error occured. Please try again later."></bui-message><bui-message text="Just an FYI, there can only be 21 million BTC."></bui-message><BuiMessage mood="success" text="₿1,000 received."></BuiMessage><BuiMessage mood="caution" text="Transaction is pending."></BuiMessage><BuiMessage mood="danger" text="An error occured. Please try again later."></BuiMessage><BuiMessage text="Just an FYI, there can only be 21 million BTC."></BuiMessage>Properties
Section titled “Properties”| Property | Attribute | Type | Required | Reflected | Description |
|---|---|---|---|---|---|
text | text | string | No | No | Message text content |
mood | mood | string | No | No | Message mood: “neutral”, “success”, “caution”, “danger” |
showIcon | show-icon | boolean | No | Yes | Whether to show an icon |
icon | icon | string | No | No | Icon name or identifier |
Valid Values
Section titled “Valid Values”Message Moods
Section titled “Message Moods”neutral- Default neutral messagesuccess- Success/positive messagecaution- Warning/caution messagedanger- Error/danger message
Behavior
Section titled “Behavior”- Mood Styling: The
moodproperty controls the visual appearance and color scheme of the message - Icon Display: The
showIconproperty controls whether an icon is displayed alongside the text - Custom Icons: The
iconproperty allows you to specify which icon to display - Text Content: The
textproperty contains the main message content - Visual Hierarchy: Different moods provide clear visual distinction for different message types
Events
Section titled “Events”The message component does not emit custom events. It behaves as a standard HTML element for displaying messages.