The four levels of a component
Foundation, composite, layout and feature. Where each one sits, and what it is allowed to know.

Zander Whitehurst
9 min read
A flat folder of components works until it doesn’t, which is usually around the thirtieth file. After that, people stop searching and start building. The fix is a small set of levels with hard edges. Four is enough. Each level has a job, a set of things it is allowed to know, and a set of things that push it up or down.
I use these four, from the inside of the diagram outward: foundation, composite, layout, feature. Layout wraps features on a page, features compose composites and foundations, and foundations never reach upward.
This is the structure a component audit is trying to produce. The levels are only useful if every existing component can be placed in one of them without a shrug.
Foundation
A foundation is the smallest single purpose unit in the interface. It is stateless, free of your domain, and portable to another product. Badge, avatar, button, flag, tag, icon, link, number.
The test I use: if the name only makes sense inside your app, it belongs one level up. CurrencyFlag describes what it renders, a flag for a currency, and could ship in any product that shows money. WiseBadge describes your company. DashboardFlag describes a page. Both of those are features wearing a foundation’s clothes.
<CurrencyFlag currency="GBP" />
<UserAvatar name="Ada Lovelace" />
<Badge tone="success">Earned</Badge>
Foundations take props that describe the render, such as tone, size and currency. They do not take plan, wallet or dashboard. They also hold no state. A button reports a click. It does not decide what the click means.
Composite
A composite is a reusable group of foundations that forms a pattern people already recognise. Avatar group, button cluster, a flag sitting next to its label, an icon paired with text. It knows how those pieces sit together. It knows nothing about the product they sit in.
<AvatarGroup>
<UserAvatar name="Ada Lovelace" />
<UserAvatar name="Grace Hopper" />
</AvatarGroup>
<ButtonCluster>
<Button variant="secondary">Cancel</Button>
<Button variant="primary">Save</Button>
</ButtonCluster>
The name describes the group, and it stays domain free. AvatarGroup is a composite. WalletCardGroup is a feature that happens to contain cards. ButtonRow describes a direction, which is layout’s job, so it fails as a composite name too. If you removed the product nouns and the row still needed to exist, you have a composite. If the name collapses without the product noun, you have a feature.
Composites may set a little layout of their own, the gap inside the cluster, the overlap of the avatars. They do not set the page’s layout, and they do not fetch or interpret domain data.
Layout
A layout component arranges children and holds no view of what those children are. Shell, section, list, bar, nav. If you removed the children, nothing meaningful would remain. That is the definition and the test.
<AppShell>
<SideNav />
<MainContent>{children}</MainContent>
</AppShell>
SideNav is a layout. It is a region that stacks navigation items, with no opinion about whether those items are wallets, settings or a marketing site. NavWrapper says nothing about the region. TransactionContainer smuggles a domain into a box that should have been a list. SidebarDiv is an HTML element pretending to be a component.
Layouts are where CSS layout syntax earns its place: grid, flex, gap, and tokens for the space between regions. They accept children and a small set of arrangement props, direction, gap, columns. A variant on a layout is a warning. Regions rarely have visual variants. When they seem to, a feature is hiding inside.
Feature
A feature is where domain knowledge lives. It understands what a wallet, a transaction or a balance actually is. It may hold local UI state, which row is open, which tab is selected. It never fetches its own data. The screen passes data in, and the feature decides how to present it.
<WalletCard wallet={wallet} />
<TransactionItem transaction={transaction} expanded={open} />
<BalanceHeader amount={amount} currency="GBP" />
This is the level that is allowed to use your nouns. WalletCard, TransactionItem, BalanceHeader, NavItem, RecipientRow are features because each one is meaningless outside the product. Card and Item are too vague to be features and too generic to sit here. WalletComponent restates the word component and tells you nothing about the job. TxnWidget abbreviates the domain and borrows a word from another era. Spell the noun, then use a suffix from the allowed list: card, item, row, panel, header.
Features compose the other three levels. A wallet card uses a layout region, a composite for the action cluster, and foundations for the avatar, the amount and the badge. A feature that reaches around those and styles a div from scratch has left the system.
How to place a component you are unsure about
Ask, in order:
- Does it know a product noun? If yes, it is a feature. Stop.
- If you deleted its children, would anything remain? If no, it is a layout.
- Is it a group of smaller pieces following a known pattern? If yes, it is a composite.
- Otherwise it is a foundation. If the name still sounds like your product, go back to question one.
When the name and the level disagree, trust the level and rename. The next article is the suffix list I use so the name and the level stay in agreement after the audit is over.
Memorisely