@payfit/unity-components
Version:
12 lines (11 loc) • 439 B
TypeScript
import { Breakpoint } from './use-breakpoint-listener.js';
/**
* A value that can be specified per breakpoint.
* At minimum, `base` (the mobile-first default) must be provided.
* @example
* { base: 1, md: 2, lg: 3 }
*/
export type ResponsiveValue<TValue> = {
base: TValue;
} & Partial<Record<Exclude<Breakpoint, 'xs'>, TValue>>;
export declare function useResponsiveValue<TValue>(value: TValue | ResponsiveValue<TValue>): TValue;