UNPKG

breakpointer

Version:

a lightweight React library for real-time breakpoint detection. supports custom and default tailwind breakpoints.

24 lines (19 loc) 861 B
import * as react_jsx_runtime from 'react/jsx-runtime'; import React, { HTMLAttributes } from 'react'; type InternalElements = "wrapper" | "iconWrapper" | "screen" | "currentWidth"; interface BreakpointerIndicatorProps extends HTMLAttributes<HTMLDivElement> { classNames?: Partial<Record<InternalElements, string[]>>; } type BreakpointProviderProps = { children: React.ReactNode; breakpointsObj?: Record<string, string | number>; classNames?: BreakpointerIndicatorProps["classNames"]; mode: string; }; declare const BreakpointerProvider: ({ children, breakpointsObj, mode, classNames, }: BreakpointProviderProps) => react_jsx_runtime.JSX.Element; interface IBreakpointerContext { screen: string; currentWidth: number; } declare const useBreakpointer: () => IBreakpointerContext; export { BreakpointerProvider, useBreakpointer };