@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
13 lines (12 loc) • 756 B
TypeScript
import { BreakpointCustomizable } from './breakpoint-customizable';
/**
* A React hook that consumes a `BreakpointCustomizable` property and returns the value
* corresponding to the current breakpoint. If the property is a primitive value, it is
* returned directly. If it is a `BreakpointValues` object, the function finds and returns
* the value for the highest defined breakpoint that is less than or equal to the current
* window width, defaulting to the `base` value if no such breakpoints are defined.
*
* @param {BreakpointCustomizable<T>} prop - The breakpoint customizable property.
* @returns {T} - The value corresponding to the current breakpoint.
*/
export declare const useBreakpointValue: <T>(prop: BreakpointCustomizable<T>) => T;