AlertBanner

Warning, an alert is coming.

Example

Props

    đŸ•šī¸ standard props
    title
    string
    The title text for the alert banner
    undefined
    description
    string
    The description text for the alert banner
    undefined
    disabled
    boolean
    Whether the alert banner is disabled and non-interactive
    false
    class
    { container?: string, border?: string, body?: string }
    Custom CSS classes for the alert banner container, border, and body
    undefined
    🎨 style props
    --alert-banner-border-radius
    size
    Border radius for the alert banner
    5px
    --alert-banner-color
    color
    Color for the alert banner
    var(--my-var-blue)
    --alert-banner-border-width
    size
    Width of the border on the alert banner
    .7rem
    --alert-banner-padding-left
    size
    Padding on the left side of the alert banner
    .5rem
    --alert-banner-padding-top
    size
    Padding on the top of the alert banner
    .3rem
    --alert-banner-padding-bottom
    size
    Padding on the bottom of the alert banner
    .3rem
    --alert-banner-padding-right
    size
    Padding on the right side of the alert banner
    .3rem
    --alert-banner-cursor
    string
    Cursor style for the alert banner
    pointer
    --alert-banner-width
    size
    Width of the alert banner
    100%

Slots

    contentSnippet
    A snippet to customize the content of the alert banner
    Default content:
    
    {#if !!title}
      {#if !!titleSnippet}
        {@render titleSnippet({ title })}
      {:else}
        <div class="title">{title}</div>
      {/if}
    {/if}
    {#if !!description}
      {#if !!descriptionSnippet}
        {@render descriptionSnippet({ description })}
      {:else}
        <div class="description">{description}</div>
      {/if}
    {/if}
            
    Available variables:
    NameTypeDescription
    titlestringThe title of the alert banner
    descriptionstringThe description of the alert banner
    titleSnippet
    A snippet to customize the title of the alert banner
    Default content:
    <div class="title">{title}</div>
    Available variables:
    NameTypeDescription
    titlestringThe title of the alert banner
    descriptionSnippet
    A snippet to customize the description of the alert banner
    Default content:
    <div class="description">{description}</div>
    Available variables:
    NameTypeDescription
    descriptionstringThe description of the alert banner
    appendSnippet
    A snippet to append additional content to the alert banner
    Available variables:
    NameTypeDescription
    disabledbooleanWhether the additional content should be disabled

Events

    onclick
    Triggered when the alert banner is clicked
    AttributeTypeDescription
    nativeEventMouseEventThe native mouse click event
    onkeypress
    Triggered when a key is pressed while focusing on the alert banner
    AttributeTypeDescription
    nativeEventKeyboardEventThe native keyboard event