All skills

Practical playbook for React teams to choose and apply reactuse hooks across state, async flows, browser APIs, and UI interactions. Use it when replacing custom hook logic with production-ready patterns that stay compatible with SSR and Next.js.

Use this Skill: https://skilld.dev/gh/siberiacancode/agent-skills/reactuse

This session only. Nothing lands on disk.

rulesuseBreakpoints.md

≈619 tokens on demand. Your agent reads this file only when SKILL.md points to it.

useBreakpoints

Manages responsive breakpoints and helper predicates.

Usage

import { useBreakpoints } from "@siberiacancode/reactuse";

const breakpoints = useBreakpoints({ mobile: 0, tablet: 640, desktop: 1024 });

Example

const breakpoints = useBreakpoints({ sm: 640, md: 768, lg: 1024 });

const active = breakpoints.active();

return (
  <div>
    Active: {active}
    <div>Is large: {String(breakpoints.greaterOrEqual("lg"))}</div>
  </div>
);

breakpoints:

Breakpoint map with pixel values.

const breakpoints = useBreakpoints({ sm: 640, md: 768, lg: 1024 });

strategy:

The strategy option controls how the shortcut properties behave:

  • min-width (default, mobile-first): breakpoints.lg is true when viewport is >= lg
  • max-width (desktop-first): breakpoints.lg is true when viewport is < xl
const breakpoints = useBreakpoints({ sm: 640, md: 768 }, "desktop-first");

between:

Check if width is between two breakpoints.

const breakpoints = useBreakpoints({ sm: 640, md: 768, lg: 1024 });
const isTablet = breakpoints.between("sm", "lg");

Presets

  • Material UI: BREAKPOINTS_MATERIAL_UI
  • Mantine: BREAKPOINTS_MANTINE
  • Tailwind: BREAKPOINTS_TAILWIND
  • Bootstrap v5: BREAKPOINTS_BOOTSTRAP_V5
  • Ant Design: BREAKPOINTS_ANT_DESIGN
  • Quasar v2: BREAKPOINTS_QUASAR_V2
  • Sematic: BREAKPOINTS_SEMANTIC
  • Master CSS: BREAKPOINTS_MASTER_CSS
  • Prime Flex: BREAKPOINTS_PRIME_FLEX
import { BREAKPOINTS_TAILWIND } from "@siberiacancode/reactuse";

Notes

  • Use only when CSS cannot solve the layout.

Type Declarations

export type Breakpoints<Breakpoint extends string = string> = Record<
  Breakpoint,
  number
>;
export type UseBreakpointsStrategy = "desktop-first" | "mobile-first";
export type UseBreakpointsReturn<Breakpoint extends string = string> = {
  greater: (breakpoint: Breakpoint) => boolean;
  greaterOrEqual: (breakpoint: Breakpoint) => boolean;
  smaller: (breakpoint: Breakpoint) => boolean;
  smallerOrEqual: (breakpoint: Breakpoint) => boolean;
  between: (a: Breakpoint, b: Breakpoint) => boolean;
  current: () => Breakpoint[];
  active: () => Breakpoint;
} & Record<Breakpoint, boolean>;
export declare const useBreakpoints: <Breakpoint extends string>(
  breakpoints: Breakpoints<Breakpoint>,
  strategy?: UseBreakpointsStrategy
) => UseBreakpointsReturn<Breakpoint>;

Source: SKILL.md on GitHub

No alerts16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive documentation and implementation guide for the Reactuse hook library, designed for React and Next.js projects. It provides clear rules, usage examples, and type declarations for a wide range of hooks, including those interacting with browser APIs. No malicious patterns, obfuscation, or security risks were detected.

  • Socket5mo

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1/166 files flagged

Signed by skilld at a090849. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
metadata
{
  "author": "siberiacancode",
  "version": "1.0.16"
}

README badge

README badge for siberiacancode/agent-skills/reactuse