frontend-patterns

Guide React and Next.js frontend patterns with component composition and state management.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/flatrick/mdt --skill frontend-patterns-flatrick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-patterns
Source: https://github.com/flatrick/mdt/tree/main/skills/frontend-patterns
Command: npx skills add https://github.com/flatrick/mdt --skill frontend-patterns-flatrick

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear, actionable examples and explanations for common and advanced frontend development patterns, helping developers build more robust, performant, and maintainable applications.

Core Features & Use Cases

  • Component Patterns: Demonstrates composition, compound components, and render props.
  • Custom Hooks: Illustrates patterns for state management, async data fetching, and debouncing.
  • State Management: Shows Context API with Reducer for global state.
  • Performance Optimization: Covers memoization, code splitting, and virtualization.
  • Form Handling: Provides examples for controlled forms with validation.
  • Accessibility: Includes patterns for keyboard navigation and focus management.

Quick Start

Show me an example of the compound components pattern in React.

Frequently Asked Questions about frontend-patterns

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

FAQPage Schema
What is the compound components pattern in React and when should I use it?

The compound components pattern in React lets you build expressive, reusable UI components by allowing parent components to implicitly share state with children. Use it to create flexible APIs for complex elements like custom select menus or tab interfaces without excessive prop drilling.

How do I optimize React performance using memoization and code splitting?

Optimize React performance by applying memoization techniques like React.memo and useMemo to prevent unnecessary re-renders. Combine this with code splitting to lazily load components, reducing the initial bundle size and improving application load times.

How do I manage global state in Next.js using Context API and reducers?

Manage global state in Next.js by combining the Context API with reducers. Wrap your application in a context provider and dispatch actions to update state, ensuring maintainable and predictable data flow across your component tree.

How do I create custom React hooks for async data fetching and debouncing?

Create custom React hooks for async data fetching and debouncing by encapsulating logic within a reusable function. Use standard React hooks internally to manage effects, handle async operations, and return the debounced value or fetched data.

What are the best practices for keyboard navigation and focus management in React?

Best practices for keyboard navigation and focus management involve managing focus explicitly during component mounting and interactions. Trap focus within modals, ensure logical tab order, and provide visible focus states to build accessible user interfaces.

Does this frontend patterns guide include examples for controlled forms with validation?

Yes, the guide includes examples for controlled forms with validation. It demonstrates how to manage form state within React components and implement validation logic to ensure data integrity before submission.