Basic Usage
Props
Controls the visual style and color of the alert:
- base: Default gray styling for general messages
- info: Blue styling for informational messages
- positive: Green styling for success messages
- warning: Yellow/amber styling for warnings
- negative: Red styling for errors or critical issues
Examples
Information Alert
Success Alert
Warning Alert
Error Alert
Base Alert
Alert with Formatted Content
Alert with Lists
Alert with Links
Multiple Alerts
Alert in Report Context
Conditional Alert
query_status
Styling Notes
The Alert component includes:- Colored border matching the status type
- Semi-transparent background in the status color
- Rounded corners for visual polish
- Automatic margin bottom for spacing
- Proper handling of first/last child markdown elements
Deprecated Status Values
The following status values are deprecated but still supported for backward compatibility:default→ usebaseinsteaddanger→ usenegativeinsteadsuccess→ usepositiveinstead
Use Cases
- Data freshness: Inform users when data was last updated
- Methodology notes: Highlight important assumptions or limitations
- Success messages: Confirm completed actions
- Error notifications: Alert users to issues or failures
- Warnings: Draw attention to potential concerns
- General information: Provide context or instructions
- Data quality indicators: Flag quality issues or validation results
Accessibility
- The component uses
role="alert"for screen reader compatibility - Color is not the only indicator (border and background provide visual distinction)
- Content supports full markdown formatting for structured information
Notes
- Supports full markdown content including bold, italic, links, and lists
- Automatically removes extra margins from first and last child elements for cleaner spacing
- Based on Flowbite alert component design
- Border and background colors are semi-transparent for better visual integration