import { Box, Banner } from '@gympass/yoga';
<Boxdisplay="flex"flexDirection="column"flex={1}justifyContent="space-between"><Bannermargin="small"variant='success'message='Success Banner'/><Bannermargin="small"variant='informative'message='Informative Banner'/><Bannermargin="small"variant='attention'message='Attention Banner'/></Box>
import { CheckedFull, AlertCircle, AlertTriangle } from '@gympass/yoga-icons';import { Box, Banner } from '@gympass/yoga';
<Boxdisplay="flex"flexDirection="column"flex={1}justifyContent="space-between"><Bannericon={CheckedFull}margin="small"variant='success'message='Success Banner'/><Bannericon={AlertCircle}margin="small"variant='informative'message='Informative Banner'/><Bannericon={AlertTriangle}margin="small"variant='attention'message='Attention Banner'/></Box>
import { Box, Banner } from '@gympass/yoga';
render(() => {const successBannerProps = {variant: 'success',message: 'Success Banner',};const informativeBannerProps = {variant: 'informative',message: 'Informative Banner',};const attentionBannerProps = {variant: 'attention',message: 'Attention Banner',};const handleOnAction = (message) => {alert(`This is your custom action ${message}`);};return (<Boxdisplay="flex"flexDirection="column"flex={1}justifyContent="space-between"><Bannermargin="small"variant={successBannerProps.variant}message={successBannerProps.message}primaryButton={{label: 'Custom Action',action: () => handleOnAction(successBannerProps.message),}}/><Bannermargin="small"variant={informativeBannerProps.variant}message={informativeBannerProps.message}primaryButton={{label: 'Custom Action',action: () => handleOnAction(informativeBannerProps.message),}}/><Bannermargin="small"variant={attentionBannerProps.variant}message={attentionBannerProps.message}primaryButton={{label: 'Custom Action',action: () => handleOnAction(attentionBannerProps.message),}}/></Box>);});
import { Box, Banner } from '@gympass/yoga';
render(() => {const successBannerProps = {variant: 'success',message: 'Success Banner',};const informativeBannerProps = {variant: 'informative',message: 'Informative Banner',};const attentionBannerProps = {variant: 'attention',message: 'Attention Banner',};const handleOnAction = (message) => {alert(`This is your custom action ${message}`);};return (<Boxdisplay="flex"flexDirection="column"flex={1}justifyContent="space-between"><Bannermargin="small"variant={successBannerProps.variant}message={successBannerProps.message}primaryButton={{label: 'Primary Action',action: () => handleOnAction(successBannerProps.message),}}secondaryButton={{label: 'Secondary Action',action: () => handleOnAction(successBannerProps.message),}}/><Bannermargin="small"variant={informativeBannerProps.variant}message={informativeBannerProps.message}primaryButton={{label: 'Primary Action',action: () => handleOnAction(informativeBannerProps.message),}}secondaryButton={{label: 'Secondary Action',action: () => handleOnAction(informativeBannerProps.message),}}/><Bannermargin="small"variant={attentionBannerProps.variant}message={attentionBannerProps.message}primaryButton={{label: 'Primary Action',action: () => handleOnAction(attentionBannerProps.message),}}secondaryButton={{label: 'Secondary Action',action: () => handleOnAction(attentionBannerProps.message),}}/></Box>);});
The Banner component also has support for margins and paddings props as you can see more details our system
| Prop | Description | Type | Default | Required |
|---|