UNPKG

@c15t/react

Version:

Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization

90 lines 3.04 kB
/** * @packageDocumentation * Provides the main cookie banner component for privacy consent management. * Implements an accessible, customizable banner following GDPR and CCPA requirements. */ import type { FC, ReactNode } from 'react'; import type { CookieBannerTheme } from './theme'; /** * Props for configuring and customizing the CookieBanner component. * * @remarks * Provides comprehensive customization options for the cookie banner's appearance * and behavior while maintaining compliance with privacy regulations. * * @public */ export interface CookieBannerProps { /** * Custom styles to apply to the banner and its child components * @remarks Allows for deep customization of the banner's appearance while maintaining accessibility * @default undefined */ theme?: CookieBannerTheme; /** * When true, removes all default styling from the component * @remarks Useful for implementing completely custom designs * @default false */ noStyle?: boolean; /** * Content to display as the banner's title * @remarks Supports string or ReactNode for rich content * @default undefined */ title?: ReactNode; /** * Content to display as the banner's description * @remarks Supports string or ReactNode for rich content * @default undefined */ description?: ReactNode; /** * Content to display on the reject button * @remarks Required by GDPR for explicit consent rejection * @default undefined */ rejectButtonText?: ReactNode; /** * Content to display on the customize button * @remarks Opens detailed consent preferences * @default undefined */ customizeButtonText?: ReactNode; /** * Content to display on the accept button * @remarks Primary action for accepting cookie preferences * @default undefined */ acceptButtonText?: ReactNode; /** * When true, the cookie banner will lock the scroll of the page * @remarks Useful for implementing a cookie banner that locks the scroll of the page * @default false */ scrollLock?: boolean; /** * When true, the cookie banner will trap focus * @remarks Useful for implementing a cookie banner that traps focus * @default true */ trapFocus?: boolean; /** * When true, disables the entrance/exit animations * @remarks Useful for environments where animations are not desired * @default false */ disableAnimation?: boolean; } export declare const CookieBanner: FC<CookieBannerProps>; /** * Component type definition for the CookieBanner with its compound components. * * @remarks * This interface extends the base CookieBanner component with additional sub-components * that can be used to compose the banner's structure. Each component is designed to be * fully accessible and customizable while maintaining compliance with privacy regulations. * * @public */ //# sourceMappingURL=cookie-banner.d.ts.map