Get the FREE Ultimate OpenClaw Setup Guide →

atomic-template

npx machina-cli add skill andireuter/skills-webapp/atomic-template --openclaw
Files (1)
SKILL.md
1.3 KB

Atomic Design: TEMPLATE (React Functional Components)

You are creating a TEMPLATE: page-level layout composition without real data binding.

Hard rules

  1. Functional components only.
  2. No real data fetching in templates. Templates define structure, regions, and composition.
  3. Slot-based design:
    • Prefer header, sidebar, content, footer regions via props/children.
    • Avoid hard-coding copy and domain-specific assumptions.
  4. Responsiveness & semantics:
    • Use proper landmarks and heading structure.
    • Ensure layout works across breakpoints (as dictated by project conventions).

Output expectations

  • Provide:
    1. Template.tsx
    2. Template.stories.tsx showing multiple compositions
    3. Optional Template.test.tsx (layout presence + landmark roles)

Recommended folder conventions

  • src/templates/<TemplateName>/...

Template checklist

  • Defines regions clearly
  • Minimal styling assumptions; flexible composition
  • No domain logic or data acquisition

Source

git clone https://github.com/andireuter/skills-webapp/blob/main/skills/atomic-template/SKILL.mdView on GitHub

Overview

Defines a React TEMPLATE for page-level layout composition without real data binding. It creates shell templates by exposing regions (header, sidebar, content, footer) that can be wired together via props or children.

How This Skill Works

Templates are built as functional components that expose slot-based regions (header, sidebar, content, footer). They avoid data fetching and domain logic, focusing on structure and composition, so other components (organisms) supply content at render time.

When to Use It

  • Creating page shells and dashboards without binding to live data
  • Prototyping list-detail layouts before data models exist
  • Building reusable app chrome that can be composed in multiple pages
  • Designing responsive layouts across breakpoints with semantic landmarks
  • Sharing a consistent layout skeleton across teams and projects

Quick Start

  1. Step 1: Create Template.tsx under src/templates/<TemplateName>/ implementing functional components and slot regions
  2. Step 2: Expose regions via props/children (header, sidebar, content, footer) and keep data fetching out
  3. Step 3: Add Template.stories.tsx to show multiple compositions and responsive behavior

Best Practices

  • Define clear regions (header, sidebar, content, footer) using props or children
  • Keep styling minimal and layout-driven; avoid domain logic
  • Use slot-based design to avoid hard-coding copy or assumptions
  • Prioritize accessibility with proper landmarks and semantic headings
  • Provide multiple compositions in stories to demonstrate flexibility

Example Use Cases

  • Admin dashboard shell with header, left navigation, main content, and footer
  • Marketing site template with a header, content region, and responsive sidebar
  • CRM list-detail page shell used by multiple records with slot-based regions
  • Documentation site layout template with consistent header and content regions
  • App-wide shell reusable across pages with swap-in content components

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers