UNPKG

@vtex/admin-ui

Version:

> VTEX admin component library

26 lines (25 loc) 818 B
/** * React hook that tracks state of a CSS media query */ export declare function useBreakpoint(): { breakpoint: Breakpoint; matches: boolean[]; }; /** * Get the responsive value for the responsive prop * @param prop the responsive prop * @param breakpoint desired breakpoint * @example * const { prop } = props * const [breakpoint] = useBreakpoint() * const responsiveProp = getResponsiveValue(prop, breakpoint) */ export declare function getResponsiveValue<T>(prop: ResponsiveProp<T>, breakpoint: Breakpoint): T; export declare type Breakpoint = 'mobile' | 'tablet' | 'desktop' | 'widescreen'; export declare type ResponsiveValue<T> = { mobile: T; tablet?: T; desktop?: T; widescreen?: T; }; export declare type ResponsiveProp<T> = T | ResponsiveValue<T>;