Go Main page
Go Main page

Web components

cover

components

Banner

v.1.0.0 | Saturn

Usage

import { Banner } from '@kubit-ui-web/react-components'
12345678910
<Banner
    align='LEFT'
    image={{
        [DeviceBreakpointsType.DESKTOP]: 'DESKTOP_IMAGE',
        [DeviceBreakpointsType.TABLET]: 'TABLET_IMAGE',
        [DeviceBreakpointsType.MOBILE]: 'MOBILE_IMAGE'
    }}
    title={{content: 'Title lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor ad'}}
    variant='PRIMARY'
/>

Props

Let's delve into the versatility of the banner component by examining all its avalaible props.

PropertyTypeDefaultDescription
align
Required
String-Banner align
backgroundPositionString'50% 50%'Property associated with the css prop background-position for the image
buttonBannerButtonType-Object with button properties
dataTestIdString-String used for testing
descriptionBannerDescriptionType-Object with description properties
image
Required
ImagesType-Image of the banner
imageAltTextString-Alt text image
onClickReact.MouseEventHandler-The event occurs when the user clicks on the element
pillBannerPillType-Object with pill properties
tagBannerTagType-Object with tag properties
title
Required
BannerTitleType-Object with title properties
variant
Required
StringPRIMARYBanner variant. There are two options: PRIMARY and ALTERNATIVE
ctvObject-Object used for update variant styles

Types

BannerButtonType

BannerButtonType is a type that contains the following properties:

  • variant: string:
  • size: string:
  • disabled?: string:
  • content: string:

BannerDescriptionType

BannerDescriptionType is a type that contains the following properties:

  • children: React.ReactNode:
  • component?: TextComponentType | GenericLinkType:
  • dataTestId?: string:
  • htmlFor?: string:
  • id?: string:
  • onClick?: React.MouseEventHandler:
  • role?: React.AriaRole:
  • color?: string:
  • display?: TextDisplayType:
  • decoration?: TextDecorationType:
  • cursor?: string:
  • weight?: number:
  • target?: string:
  • align?: string:
  • transform?: TextTransformType:
  • url?: string:
  • draggable?: boolean:
  • variant?: string:
  • content: string:

BannerPillType

BannerPillType is a type that contains the following properties:

  • initialState?: boolean:
  • focus?: boolean:
  • content: string:

BannerTagType

BannerTagType is a type that contains the following properties:

  • children: React.ReactNode:
  • variantStatusStyles?: TagStylesVariantPropsType:
  • optionStyles: TagStylesOptionPropsType;
  • dataTestId?: string:
  • icon?: IElementOrIcon:
  • variant: string:
  • truncateText?: boolean:
  • option: string:
  • status: string:
  • content: string:

BannerTitleType

BannerTitleType is a type that contains the following properties:

  • children: React.ReactNode:
  • component?: TextComponentType | GenericLinkType:
  • dataTestId?: string:
  • htmlFor?: string:
  • id?: string:
  • onClick?: React.MouseEventHandler:
  • role?: React.AriaRole:
  • color?: string:
  • display?: TextDisplayType:
  • decoration?: TextDecorationType:
  • cursor?: string:
  • weight?: number:
  • target?: string:
  • align?: string:
  • transform?: TextTransformType:
  • url?: string:
  • draggable?: boolean:
  • variant?: string:
  • content: string: