- Home
- Skills
- Agents Inc
- Skills
- Web Framework React
web-framework-react_skill
0
GitHub Stars
3
Bundled Files
2 months ago
Catalog Refreshed
3 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill agents-inc/skills --skill web-framework-react- metadata.yaml513 B
- reference.md7.6 KB
- SKILL.md18.5 KB
Overview
This skill teaches building composable React component libraries and patterns tailored for React 19. It documents a tiered component architecture, React 19 ref-as-prop conventions, hooks related to Actions and form state, icon usage, and common patterns for events, variants, and error handling. Practical guidance ensures components are customizable, accessible, and aligned with modern React APIs.
How this skill works
The skill inspects component design and implementation patterns across four tiers: primitives, components, patterns, and templates. It explains how to declare props (including passing ref as a regular prop), expose className for styling, define type-safe variant props, and use React 19 hooks such as use(), useActionState, useFormStatus, and useOptimistic. It also covers icon integration with lucide-react, event handler naming, custom hooks, and error boundary strategies.
When to use it
- Building a reusable component library or design system
- Creating interactive, stateful components that use React 19 Actions
- Implementing type-safe variant and size props for UI controls
- Adding accessible icon-only buttons and icon integrations with lucide-react
- Handling form submissions with automatic pending/error state
Best practices
- Organize components in tiers: primitives → components → patterns → templates
- Pass ref as a regular prop in React 19 and expose className on all reusable components
- Use named exports and named constants for numeric values to avoid magic numbers
- Use useActionState for form actions and useFormStatus in child submit controls to avoid prop drilling
- Only introduce variant abstractions when a component has multiple visual variants; prefer simple APIs otherwise
Example use cases
- A Button component exposing variant, size, className, and ref for broad reuse
- A ProfileForm using useActionState to manage pending and error states during submission
- An Alert component with type-safe variant props and a named ANIMATION_DURATION_MS constant
- An icon-only social links list using lucide-react with title and aria-label for accessibility
- An ErrorBoundary wrapping a feature area with a retry button and error logging
FAQ
React 19 removes the need for forwardRef boilerplate; passing ref as a regular prop simplifies component code and aligns with the new API.
When should I add variant props to a component?
Add variant or size props only when the component has two or more visual variants; avoid over-engineering single-variant controls.