UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

22 lines (21 loc) 685 B
import type { BreakpointValue } from "../components/Breakpoint/Breakpoint.js"; /** * Usage: useBreakpoint(from, to) where from and to are optional viewport width * keywords: * * - small = 600px * - medium = 960px * - large = 1280px * - xl = 1600px * - xxl = 1920px * * @returns `true` if screen width is within range (otherwise `false`) * * @see https://bifrost.intility.com/react/useBreakpoint * * @example * const toSmall = useBreakpoint(null, "small"); * const fromSmallToMedium = useBreakpoint("small", "medium"); * const fromMedium = useBreakpoint("medium"); */ export default function useBreakpoint(from: BreakpointValue | null, to?: BreakpointValue): boolean;