Skip to main content

Banner

Used to provide high-level content in a heading, paragraph, and image format within a pressable for navigation.

Submit feedback
github
import { Banner } from '@uhg-abyss/mobile';
      <Banner />

      Variants

      Use the variant prop to set the type of Banner to render.

      Background

      Use the background prop to set the background color of the banner. The default value is white.

      Image

      Use the image prop to set an image in the image container of the banner.

      Image Background Color

      Use the imageBackgroundColor prop to set an image in the image container of the banner. The default is $semantic.color.surface.interactive.standards.rest.quaternary.

      CTA

      Use the cta prop to set a call to action button in the banner. If a cta is set the number of lines of the heading paragraph are limited depending on the size of the CTA. To view the truncation rules, see the Banner truncation conditions.

      Banner Props

      Prop NameTypeDefaultDescription
      backgroundstringwhiteThe background color of the banner.
      ctaReact.ReactNode-The action of the banner.
      headingstring-The heading text of the banner.
      imageReact.ReactNode-The image of the banner.
      imageBackgroundColorstring$semantic.color.surface.interactive.standards.rest.quaternaryThe background color of the image container.
      isVisiblebooleantrueFlag to indicate if the banner is visible.
      onClosefunction-Callback function when the banner is closed. This prop is only used when isClosable is true.
      paragraphstring-The paragraph text of the banner.
      variant'horizontal' | 'vertical-lg' | 'vertical-sm' | 'branded''horizontal'The variant of the banner.

      Banner Classes

      Class NameDescription
      abyss-banner-contentContainer for heading and paragraph
      abyss-banner-headingHeading text
      abyss-banner-image-containerContainer for image or icon
      abyss-banner-paragraphParagraph text
      abyss-banner-rootRoot element of the component

      Dynamic Type

      Text and icons scale to Abyss standards. Any images, illustrations, or IconBrand passed to Banner should not scale. Size AX5 and larger cause reordering and resizing of all variants.

      Banner Tokens

      Token NameValue
      banner.color.surface.container.white
      #FFFFFF
      banner.color.surface.container.emphasis-2
      #FAF8F2
      banner.color.surface.container.emphasis-1
      #F0F9ED
      banner.color.surface.container.emphasis-3
      #EEF8FB
      banner.color.surface.container.emphasis-4
      #F7FCFD
      banner.color.surface.branding-container
      #FFFFFF
      banner.color.surface.close-icon-container
      rgba(255,255,255,0.6)
      banner.color.text.heading
      #002677
      banner.color.text.paragraph
      #4B4D4F
      banner.color.text.eyebrow
      #4B4D4F
      banner.color.border.container
      #CBCCCD
      banner.color.icon.utility
      #002677
      banner.color.icon.close
      #4B4D4F
      banner.border-radius.all.container
      12
      banner.border-radius.all.close-icon-container
      500
      banner.border-width.all.container
      0.5
      banner.sizing.icon.all.utility
      16
      banner.sizing.icon.all.close
      24
      banner.spacing.gap.vertical.container.featured
      8
      banner.spacing.gap.vertical.container.branded
      12
      banner.spacing.gap.vertical.text
      2
      banner.spacing.padding.all.content
      16
      banner.spacing.padding.all.close-icon-container
      2
      banner.spacing.padding.all.container.branded
      16
      banner.box-shadow.container
      • Shadow Color: rgba(0,0,0,0.16)
      • Shadow Offset:
        • Width: 0
        • Height: 4
      • Shadow Opacity: 1
      • Shadow Radius: 4

      Banner Classes

      V2V1Status
      banner-close-buttonbanner-close-buttonUnchanged
      banner-close-icon-Added
      banner-contentbanner-contentUnchanged
      -banner-eyebrowRemoved
      -banner-footerRemoved
      banner-headingbanner-titleRenamed
      banner-image-containerbanner-image-containerUnchanged
      banner-paragraphbanner-descriptionRemoved
      banner-rootbanner-rootUnchanged
      -banner-text-wrapperRemoved

      Banner Props

      V2V1Status
      backgroundcolorRenamed
      -centerTextRemoved
      -contentRemoved
      cta-Added
      -ctaTypeRemoved
      -eyebrowRemoved
      -fixedRemoved
      -footerRemoved
      -growRemoved
      headingtitleRenamed
      -hrefRemoved
      imageimageUnchanged
      imageBackgroundColorimageBackgroundColorUnchanged
      -isCloseableRemoved
      -isDisabledRemoved
      isVisibleisVisibleUnchanged
      -linkIconRemoved
      -linkTextRemoved
      onCloseonCloseUnchanged
      -onPressRemoved
      paragraphdescriptionRenamed
      -showExternalIconRemoved
      -textSizeRemoved
      variantvariantModified
      Table of Contents