Skip to content
EliteChart

getBreakpoint

Documentation


Documentation / @elitechart/core / getBreakpoint

code
function getBreakpoint(width): "xs" | "sm" | "md" | "lg" | "xl" | "xxl";

Defined in: theme/responsive.ts:41

Return the largest breakpoint whose min-width is ≤ width. Use to branch UI density on resize.

Parameters

width

number

Returns

"xs" | "sm" | "md" | "lg" | "xl" | "xxl"

Example

code
import { getBreakpoint } from '@elitechart/core';
const bp = getBreakpoint(window.innerWidth);
if (bp === 'xs' || bp === 'sm') hideSidebar();