Feedback

Alert

Static contextual feedback messages with icons and actions.

Basic Usage

Contextual feedback messages for highlighting information, success, warnings, or errors.

'use client'

import React from 'react'
import { Stack, Alert } from 'biibaos'
import { Info } from 'lucide-react'

export default function App() {
  return (
    <Stack direction="column" gap={12} style={{ width: '100%' }}>
            <Alert title="Default Alert" description="This is a simple information alert." />
            <Alert variant="success" title="Success Alert" description="Your changes have been saved." />
            <Alert variant="warning" title="Warning Alert" description="Your session is about to expire." />
            <Alert variant="danger" title="Danger Alert" description="There was an error processing your request." />
            <Alert variant="info" title="Info Alert" description="New updates are available." />
          </Stack>
  )
}

With Action

Alerts can include a primary action button on the far right.

'use client'

import React from 'react'
import { Alert } from 'biibaos'

export default function App() {
  return (
    <Alert
            variant="info"
            title="Update Available"
            description="Version 2.0.4 is now available for download."
            action={{ label: 'Update now', onClick: () => alert('Updating...') }}
          />
  )
}

Dismissible

Add an onClose callback to show a close button.

'use client'

import React from 'react'
import { Alert } from 'biibaos'

export default function App() {
  return (
    <Alert
            variant="warning"
            title="Attention Required"
            description="Please review your privacy settings."
            onClose={() => alert('Closed')}
          />
  )
}

Properties

PropTypeDefaultDescription
titlestringStructural modal header title
descriptionReact.ReactNodeSupporting description or helper guidance text
variantAlertVariant'default'Semantic design theme variant
onClose() => voidCallback function triggered when closing the overlay
closeIconReact.ReactNodeConfigures the closeIcon option
styleReact.CSSPropertiesInline CSS styles for custom overrides
classNamestringAdditional CSS class names to apply to the root element
iconReact.ReactNodeCustom icon prefix element
action{ label: stringConfigures the action option
onClick() => voidClick event callback handler