UNPKG

@pchmn/expo-material3-theme

Version:

Manage Material 3 theme in your React Native App

51 lines 1.99 kB
import { Material3Scheme, Material3Theme } from './ExpoMaterial3Theme.types'; import { Material3ThemeOptions } from './utils/createMaterial3Theme'; export declare const isDynamicThemeSupported: boolean; interface UseMaterial3ThemeOptions extends Material3ThemeOptions { /** * Source color for the theme. * * If provided, it will overwrite the system theme. * */ sourceColor?: string; /** * Source color for the fallback theme. * @default '#6750A4' */ fallbackSourceColor?: string; } /** * Hook to manage material3 theme. * * It returns: * - a Material 3 theme: * - the system theme (or a fallback theme if not supported) if sourceColor is not provided * - a theme based on sourceColor if provided * - a function to update the theme based on a source color * - a function to reset the theme to default * @returns */ export declare function useMaterial3Theme(options?: UseMaterial3ThemeOptions): { theme: Material3Theme; updateTheme: (sourceColor: string, options?: Material3ThemeOptions) => void; resetTheme: () => void; }; /** * Get the Material 3 theme from the system (works only on Android 12+). * * If the system does not support Material3, it will return a theme based on the fallback source color. * * @param fallbackSourceColor source color for the fallback theme (default to #6750A4) * @returns */ export declare function getMaterial3Theme(fallbackSourceColor?: string, options?: Material3ThemeOptions): Material3Theme; export declare function getMaterial3ThemeAsync(fallbackSourceColor?: string, options?: Material3ThemeOptions): Promise<Material3Theme>; /** * Create a Material 3 theme based on the source color. * * @param sourceColor source color for the theme * @returns */ export declare function createMaterial3Theme(sourceColor: string, options?: Material3ThemeOptions): Material3Theme; export { Material3Scheme, Material3Theme, Material3ThemeOptions }; //# sourceMappingURL=index.d.ts.map