All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.components.Banner.Banner.tsx Maven / Gradle / Ivy

Go to download

This library provides a set of common React components for use with the PatternFly reference implementation.

The newest version!
import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/Banner/banner';
import { css } from '@patternfly/react-styles';

export interface BannerProps extends React.HTMLProps {
  /** Content rendered inside the banner. */
  children?: React.ReactNode;
  /** Additional classes added to the banner. */
  className?: string;
  /** If set to true, the banner sticks to the top of its container */
  isSticky?: boolean;
  /** Text announced by screen readers to indicate the type of banner. This prop should only
   * be passed in when the banner conveys status/severity.
   */
  screenReaderText?: string;
  /** Variant styles for the banner. */
  variant?: 'default' | 'blue' | 'red' | 'green' | 'gold';
}

export const Banner: React.FunctionComponent = ({
  children,
  className,
  variant = 'default',
  screenReaderText,
  isSticky = false,
  ...props
}: BannerProps) => (
  
{screenReaderText && {screenReaderText}} {children}
); Banner.displayName = 'Banner';




© 2015 - 2024 Weber Informatics LLC | Privacy Policy