Skip to main content

Banner: React

Use banners to alert users about important information.

Installation

Before you can start using the @mediahuis/chameleon-react component, you’ll need to install it, for more information check: Getting started for developers.

With that done, you’re now ready to implement the component in your application.

import { Banner } from '@mediahuis/chameleon-react';

export default function Example() {
return <Banner>Example banner</Banner>;
}

Properties

PropertyTypeDefaultRequiredDescription
accessibilityLabelCloseButtonString'Close'NoSets the accessibility label for the close button.
appearance'error' | 'info' | 'success' | 'warning'-NoControls the background and text.
childrenReactNode-NoThe body content.
closeHiddenBooleanfalseNoDetermines whether the close button should be hidden or not.
onCloseFunction-NoThis event is triggered when the close button is clicked.
showBoolean-NoControls the visibility.