UNPKG

themeshift

Version:

A lightweight, customizable dark mode and theme toggler for React applications

21 lines (20 loc) 616 B
import { Theme } from './themes'; export interface UseThemeShiftOptions { defaultTheme?: string; transitionDuration?: number; storage?: Storage; } export interface CustomTheme extends Theme { id: string; } export declare function useThemeShift(options?: UseThemeShiftOptions): { currentTheme: string; setTheme: (themeName: string) => void; isTransitioning: boolean; availableThemes: { [x: string]: Theme | CustomTheme; }; customThemes: Record<string, CustomTheme>; addCustomTheme: (theme: CustomTheme) => void; removeCustomTheme: (themeId: string) => void; };