Top Banner

    Introduction

    Top banner is a top section on the website, which is designed for promotional purposes.

    Top banner structure
    1. Message - A short (normally 1 line) text content.
    2. Action - Resembles a button with an icon.
    3. Close button - A button to close the banner (optional).
    4. Background - An image or a color-background with the height of 48px.

    Examples

    Styles

    Depending on the promotion themes, the top banner will be designed flexibly by color scheme which was defined in the Color library.

    • The height is fixed on all platforms (desktop, tablet and mobile).
    • Responsive: Using marquee from right to left to the top banner content on tablet and mobile.
    • Image background is inside the container (12 columns).
    ## Design Reference

    N/A

    API

    TopBanner

    import { TopBanner } from  '@ahaui/react'Copy import code for the TopBanner component
    NameTypeDefaultDescription
    bgImage
    node

    Sets image shape as background.

    dismissible
    boolean
    false

    Renders a properly aligned dismiss button, as well as adding extra horizontal padding to the TopBanner.

    show
    boolean
    true
    controlled by: onClose, initial prop: defaultShow

    Controls the visual state of the TopBanner.

    onClose
    function

    Callback fired when TopBanner is closed.

    transition
    elementType
    <Fade>

    A react-transition-group Transition component used to animate the TopBanner on dismissal.

    Powered by Got It, Inc.Slack