react-container-presentation-component

Scaffolds React components following the Container/Presentation pattern with TypeScript, SCSS, and Storybook files.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill react-container-presentation-component
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-container-presentation-component
Source: https://github.com/github/awesome-copilot/tree/main/skills/react-container-presentation-component
Command: npx skills add https://github.com/github/awesome-copilot --skill react-container-presentation-component

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Manually creating React components that consistently follow the Container/Presentation pattern is error-prone: developers mix state logic into presentational files, misclassify components, or forget required files like stories and type contracts. This Skill enforces a repeatable scaffolding workflow with clear classification rules.

Core Features & Use Cases

  • Guided Component Scaffolding: Asks for the component name and type (ui or features), then creates the correct file set under src/components (e.g., index.tsx, use<ComponentName>.tsx, presentation.tsx, types.ts, stories, and SCSS modules).
  • Classification Enforcement: Applies a reclassification rule so components containing state, side effects, async logic, or store access are treated as features rather than ui, with user confirmation before proceeding.
  • Convention Compliance: Bundled references define TypeScript rules (no any, type over interface, explicit return types) and SCSS token rules (theme colors, z-index scale, margin constraints), plus Storybook minimum story requirements.
  • Use Case: When adding a new UserCard component, run the skill, answer ui or features, and receive a complete, lint-passing component folder with stories and an optional replacement of direct Mantine usage in existing features.

Quick Start

Ask the assistant to create a new React component named UserCard of type features using the Container/Presentation pattern.

Frequently Asked Questions about react-container-presentation-component

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

FAQPage Schema
How do I create a React component with the Container/Presentation pattern?

Provide a PascalCase component name and choose ui or features. The skill creates the required files: features get index.tsx, a custom hook, presentation.tsx, types.ts, stories, and SCSS; ui components get a stateless render-only file set.

What is the difference between ui and features components in React?

ui components are stateless, render-only components that receive data and callbacks via props. features components contain state management, side effects, async logic, and store access, split into a container layer and a presentation layer.

When should a React component be reclassified from ui to features?

Reclassify when the implementation uses useState, useReducer, useEffect, API calls, timers, context or store read-write, or business logic. The skill asks for confirmation to either create it as features or move the logic to a parent.

Can ui components import features components in this architecture?

No. The dependency direction only allows features to import ui. ui importing features is forbidden to keep reusable presentational components free of business logic dependencies.

What Storybook stories are required for a new React component?

A Default story is always required. Additional stories are added only for distinct states, such as Hover for interactive controls, Focus/Error/Disabled for inputs, or Open/Closed/Empty for layout components.

What TypeScript and SCSS rules does this component structure enforce?

TypeScript rules ban any, prefer type over interface for props, and require explicit return types. SCSS rules require theme and z-index tokens, ban negative margins and hardcoded z-index, and restrict margins to margin-top and margin-left.