canvas-component-composability

Design composable Canvas components using slots-first decomposition patterns.

14|2|Updated Feb 14, 2025
One-click install
npx skills add https://github.com/balintbrews/canvas-starter --skill canvas-component-composability-balintbrews
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canvas-component-composability
Source: https://github.com/balintbrews/canvas-starter/tree/main/.agents/skills/canvas-component-composability
Command: npx skills add https://github.com/balintbrews/canvas-starter --skill canvas-component-composability-balintbrews

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Designers and developers struggle to keep Canvas components small, reusable, and composable as projects grow, so this Skill guides decomposition-first patterns and slot-based composition.

Core Features & Use Cases

  • Slot-driven composition to enable flexible, reusable components without deep prop trees.
  • Common decomposition patterns to extract repeated UI into standalone pieces (e.g., article-meta, metadata-item, card sections).
  • Guidelines on when to decompose and how to map props to slots for consistent Canvas compatibility.

Quick Start

Start by outlining the component's slots and mapping them to small child components.

Frequently Asked Questions about canvas-component-composability

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

FAQPage Schema
How do I decompose large React Canvas components into smaller reusable pieces?

Decompose React Canvas components by applying a slots-first approach that maps props to small child components, establishing clear boundaries between layout, content, and behavior to improve reuse and scalability.

What is slot-driven composition in Canvas component design?

Slot-driven composition in Canvas component design defines specific areas via component.yml to enable flexible, reusable components without relying on deep prop trees, aligning with Canvas' slot and child composition rules.

When should I break down UI components using a decomposition-first pattern?

Apply a decomposition-first pattern when UI components are growing too large or require clear boundaries between layout, content, and behavior, such as when managing complex article headers, metadata sections, and card collections.

How do I extract repeated UI patterns into standalone Canvas components?

Extract repeated UI patterns into standalone Canvas components by outlining the component's slots and mapping them to small child components, creating reusable pieces like article-meta, metadata-item, and card sections.

Can I use this slots-first approach to map props for existing Canvas components?

Yes, you can apply this slots-first approach to existing Canvas components by mapping their props to slots, which helps reduce deep prop trees and aligns the components with Canvas' composition rules for better maintainability.

Does this decomposition pattern require any external dependencies for React projects?

No external dependencies are required to implement this decomposition pattern in React projects, as it focuses on defining slots via component.yml and applying decomposition-first design rules natively.