frontend-patterns

Implements React and Next.js patterns for components, state, performance, and accessibility.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill frontend-patterns-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-patterns
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/frontend-patterns
Command: npx skills add https://github.com/ibytechaos/claude --skill frontend-patterns-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend developers often reinvent solutions for common challenges like component composition, state management, data fetching, and performance optimization, leading to inconsistent and hard-to-maintain codebases. ## Core Features & Use Cases - Component Patterns: Provides composition, compound components, and render props patterns with TypeScript examples for building reusable React UI. - State & Data Fetching: Covers Context + Reducer state management, custom hooks (useToggle, useQuery, useDebounce), and async data loading patterns. - Performance & Accessibility: Includes memoization, code splitting, list virtualization with @tanstack/react-virtual, Framer Motion animations, keyboard navigation, and focus management. - Use Case: When building a dashboard with a long scrollable list of items, apply the virtualization pattern with useVirtualizer and lazy-load heavy chart components to keep the UI responsive. ## Quick Start Ask the assistant to apply the frontend-patterns skill to refactor a React component using composition, memoization, and accessible keyboard navigation.

Frequently Asked Questions about frontend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage state in React with Context and useReducer?

Combine React Context with useReducer by defining a state interface, action types, and a reducer function, then wrap your app in a Provider component. Create a custom hook like useMarkets that reads the context and throws an error if used outside the provider.

How to optimize React performance with memoization?

Use useMemo for expensive computations like sorting large lists, useCallback for functions passed to child components, and React.memo for pure components that re-render unnecessarily. These prevent redundant calculations and renders when dependencies have not changed.

What is the compound components pattern in React?

Compound components share implicit state through React Context, letting parent components like Tabs coordinate children like TabList and Tab. This gives flexible composition APIs where child components access shared state without explicit prop drilling.

Does React virtualization work with dynamic row heights?

Yes, @tanstack/react-virtual supports dynamic sizes through its estimateSize function and measurement APIs. The useVirtualizer hook recalculates positions as items render, handling variable-height rows in long scrollable lists.

When should I use render props versus custom hooks?

Custom hooks like useQuery are preferred for reusable logic since they compose cleanly and avoid wrapper nesting. Render props remain useful when a component needs to control rendering output directly, such as a DataLoader passing loading and error states to children.

How do I make a React modal accessible with focus management?

Store the previously focused element when the modal opens, move focus into the modal container, and restore focus on close. Add role="dialog", aria-modal="true", and handle the Escape key to close, ensuring keyboard users can navigate properly.