Breakpoint
typeSource L13Type contract for Breakpoint.
type Breakpoint = keyof typeof breakpointsOpen-code aq-ui React hook for Use Breakpoint.
pnpm dlx aq-ui@alpha add use-breakpointImport the parts you need, then jump to an export for its contract.
"use client"
import { useBreakpoint } from "@/hooks/use-breakpoint"Type contract for Breakpoint.
type Breakpoint = keyof typeof breakpointsPublic const export from Use Breakpoint.
const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280, "2xl": 1536, } as constOpen-code aq-ui React hook for Use Breakpoint.
function useBreakpoint(breakpoint: Breakpoint | number, { direction = "up", defaultValue = false }: UseBreakpointOptions = {}): booleanboolean| Name | Type | Default |
|---|---|---|
breakpoint | Breakpoint | number | — |
options? | UseBreakpointOptions | {} |
Type contract for UseBreakpointOptions.
interface UseBreakpointOptions| Name | Type | Default |
|---|---|---|
direction? | "up" | "down" | "up" |
defaultValue? | boolean | false |
use-media-query