@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
87 lines (86 loc) • 3.25 kB
TypeScript
import type { BaseProps } from '../../BaseProps';
import type { BannerHeadingTag, BreakpointCustomizable, BannerPosition, BannerState } from '../types';
export type PBannerProps = BaseProps & {
/**
* Sets the supporting description text shown below the heading.
* @default ''
*/
description?: string;
/**
* Shows a dismiss button so the user can manually close the banner.
* @default true
*/
dismissButton?: boolean;
/**
* Sets the heading text displayed at the top of the banner.
* @default ''
*/
heading?: string;
/**
* Sets the HTML heading tag (e.g. h2, h3) to maintain correct document structure for the heading.
* @default 'h5'
*/
headingTag?: BannerHeadingTag;
/**
* Emitted when the user closes the banner via the dismiss button or Escape key.
*/
onDismiss?: (event: CustomEvent<void>) => void;
/**
* Controls whether the banner is visible. Set to `true` to show it and `false` to hide it.
* @default false
*/
open: boolean;
/**
* Sets the position of the banner on screen — `top` or `bottom`. Supports responsive breakpoint values.
* @default { base: 'bottom', s: 'top' }
*/
position?: BreakpointCustomizable<BannerPosition>;
/**
* Sets the visual state of the banner — controls the icon and color scheme (`info`, `warning`, `error`, `success`).
* @default 'info'
*/
state?: BannerState;
};
export declare const PBanner: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "inputMode" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
/**
* Sets the supporting description text shown below the heading.
* @default ''
*/
description?: string;
/**
* Shows a dismiss button so the user can manually close the banner.
* @default true
*/
dismissButton?: boolean;
/**
* Sets the heading text displayed at the top of the banner.
* @default ''
*/
heading?: string;
/**
* Sets the HTML heading tag (e.g. h2, h3) to maintain correct document structure for the heading.
* @default 'h5'
*/
headingTag?: BannerHeadingTag;
/**
* Emitted when the user closes the banner via the dismiss button or Escape key.
*/
onDismiss?: (event: CustomEvent<void>) => void;
/**
* Controls whether the banner is visible. Set to `true` to show it and `false` to hide it.
* @default false
*/
open: boolean;
/**
* Sets the position of the banner on screen — `top` or `bottom`. Supports responsive breakpoint values.
* @default { base: 'bottom', s: 'top' }
*/
position?: BreakpointCustomizable<BannerPosition>;
/**
* Sets the visual state of the banner — controls the icon and color scheme (`info`, `warning`, `error`, `success`).
* @default 'info'
*/
state?: BannerState;
} & {
children?: import("react").ReactNode | undefined;
} & import("react").RefAttributes<HTMLElement>>;