UNPKG

@codegouvfr/react-dsfr

Version:

French State Design System React integration library

41 lines (40 loc) 1.52 kB
import type { ReactNode } from "react"; import type { DefaultColorScheme } from "./zz_internal/defaultColorScheme"; export type DsfrProviderProps = { children: ReactNode; lang: string | undefined; /** Default: false */ verbose?: boolean; /** * When true, the nonce of the script tag will be checked, fetched from {@link DsfrHead} component and injected in react-dsfr scripts. * * @see https://developer.mozilla.org/fr/docs/Web/HTML/Global_attributes/nonce * @default false */ doCheckNonce?: boolean; /** * Enable Trusted Types with a custom policy name. * * Don't forget to also add the policy name in {@link DsfrHead} component. * * `<trustedTypesPolicyName>` and `<trustedTypesPolicyName>-asap` should be set in your Content-Security-Policy header. * * For example: * ```txt * With a policy name of "react-dsfr": * Content-Security-Policy: * require-trusted-types-for 'script'; * trusted-types react-dsfr react-dsfr-asap nextjs nextjs#bundler; * ``` * * @see https://developer.mozilla.org/fr/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types * @see {@link DEFAULT_TRUSTED_TYPES_POLICY_NAME} * @default "react-dsfr" */ trustedTypesPolicyName?: string; }; export declare function DsfrProviderBase(props: DsfrProviderProps & { Link: Function; defaultColorScheme: DefaultColorScheme; }): JSX.Element; export declare function StartDsfrOnHydration(): null;