gitwtfhub

wtf is macro-components?

gaearon/macro-components — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2018-01-31

5JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

A React library that lets you build composite UI components (like cards or banners) by defining a layout once, so children slot in automatically without custom props.

Mindmap

mindmap
  root((repo))
    What It Does
      Define layout once
      Auto-slot children
      No custom props
    Tech Stack
      JavaScript
      React
    Use Cases
      Design systems
      Reusable UI patterns
      Cards and banners
    Audience
      Component library authors
      Design system builders
    Extras
      Clone utility
      Works with styled-components

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a reusable Banner component where Heading and Subhead children automatically slot into place.

REASON 2

Create a design-system component library without writing elaborate prop APIs for every layout variant.

REASON 3

Use the Clone utility to apply default styling to child elements passed into a layout.

What's in the stack?

JavaScriptReact

How it stacks up

gaearon/macro-components00kaku/wp-rest-playgroundchalarangelo/mini-active-record
Stars555
LanguageJavaScriptJavaScriptJavaScript
Last pushed2018-01-31
MaintenanceDormant
Setup difficultyeasyhardeasy
Complexity2/53/51/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Yoink these prompts

Prompt 1
Show me how to use macro() to turn a layout function into a React component.
Prompt 2
Help me build a Card component with macro-components that accepts Image, Title, and Description children.
Prompt 3
How does macro-components figure out which child goes where without custom props?
Prompt 4
Show me how to use the Clone utility to set default styles on optional children.

Frequently asked questions

wtf is macro-components?

A React library that lets you build composite UI components (like cards or banners) by defining a layout once, so children slot in automatically without custom props.

What language is macro-components written in?

Mainly JavaScript. The stack also includes JavaScript, React.

Is macro-components actively maintained?

Dormant — no commits in 2+ years (last push 2018-01-31).

How hard is macro-components to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is macro-components for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.