dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
24 lines • 1.08 kB
TypeScript
import { ReactNode } from 'react';
import { ThemeMode } from '../enums';
/**
* Props for the ThemeProvider component.
*/
export type ThemeProviderProps = {
/** The content to be wrapped by the provider. */
children: ReactNode;
/** The default theme to use if no preferred theme is stored. Defaults to SYSTEM. */
defaultTheme?: ThemeMode;
/** The key used to store the theme preference in localStorage. Defaults to "theme". */
storageKey?: string;
};
/**
* ThemeProvider manages the application's theme state.
* It syncs the theme with localStorage and applies the corresponding CSS class to the document root.
*
* @param props.children - Child components.
* @param props.defaultTheme - Default theme mode.
* @param props.storageKey - Local storage key for persistence.
* @returns {JSX.Element} Context provider wrapping children with theme state
*/
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=ThemeProvider.d.ts.map