layout-primitives
БесплатноБез исполняемых скриптовНе проверенBuilds composable layout components (Stack, Cluster, Grid, Sidebar, Center, Cover). Use when creating layout systems, spacing compositions, or Every…
Об этом скилле
Layout Primitives
Overview
Build reusable layout primitives (Stack, Cluster, Sidebar, Grid) that compose to create any layout. Based on Every Layout patterns - intrinsic design that adapts without breakpoints.
When to Use
- Setting up layout components for a design system
- Creating composable layout building blocks
- Replacing repetitive flexbox/grid patterns
- Building layouts that adapt without media queries
- Implementing consistent spacing throughout an app
Quick Reference: Core Primitives
| Primitive | Purpose | Primary CSS |
|---|---|---|
| Stack | Vertical spacing | flex-direction: column + gap |
| Cluster | Horizontal wrapping groups | flex-wrap: wrap + gap |
| Sidebar | Two-column with minmax | flex-wrap: wrap + basis |
| Switcher | Stack/row based on width | flex-wrap + container query |
| Center | Centered max-width | max-width + margin-inline: auto |
| Cover | Vertically centered hero | min-height + flex |
| Grid | Auto-fill responsive grid | grid-template-columns: repeat(auto-fill) |
| Frame | Aspect ratio container | aspect-ratio |
| Reel | Horizontal scroll | overflow-x: auto + flex-wrap: nowrap |
| Box | Spacing/padding container | padding |
Stack
Vertical rhythm with consistent spacing.
CSS
.stack {
display: flex;
flex-direction: column;
}
.stack > * + * {
margin-block-start: var(--stack-space, 1.5rem);
}
/* Or with gap (modern, simpler) */
.stack {
display: flex;
flex-direction: column;
gap: var(--stack-space, 1.5rem);
}
/* Variants */
.stack[data-space="sm"] { --stack-space: 0.5rem; }
.stack[data-space="md"] { --stack-space: 1rem; }
.stack[data-space="lg"] { --stack-space: 2rem; }
.stack[data-space="xl"] { --stack-space: 4rem; }
React Component
interface StackProps {
space?: 'sm' | 'md' | 'lg' | 'xl';
as?: React.ElementType;
children: React.ReactNode;
className?: string;
}
export function Stack({
space = 'md',
as: Component = 'div',
children,
className,
}: StackProps) {
return (
<Component
className={clsx('stack', className)}
data-space={space}
>
{children}
</Component>
);
}
// Usage
<Stack space="lg">
<h1>Title</h1>
<p>Paragraph</p>
<p>Another paragraph</p>
</Stack>
Tailwind Utility
// Tailwind approach
<div className="flex flex-col gap-4">
{/* children */}
</div>
// With custom component
function Stack({ space = 4, children }) {
return (
<div className={`flex flex-col gap-${space}`}>
{children}
</div>
);
}
Cluster
Horizontal grouping that wraps naturally.
CSS
.cluster {
display: flex;
flex-wrap: wrap;
gap: var(--cluster-space, 1rem);
align-items: var(--cluster-align, center);
justify-content: var(--cluster-justify, flex-start);
}
/* Variants */
.cluster[data-justify="center"] { justify-content: center; }
.cluster[data-justify="space-between"] { justify-content: space-between; }
.cluster[data-justify="end"] { justify-content: flex-end; }
.cluster[data-align="start"] { align-items: flex-start; }
.cluster[data-align="end"] { align-items: flex-end; }
.cluster[data-align="stretch"] { align-items: stretch; }
React Component
interface ClusterProps {
space?: 'xs' | 'sm' | 'md' | 'lg';
justify?: 'start' | 'center' | 'end' | 'space-between';
align?: 'start' | 'center' | 'end' | 'stretch';
children: React.ReactNode;
className?: string;
}
export function Cluster({
space = 'md',
justify = 'start',
align = 'center',
children,
className,
}: ClusterProps) {
return (
<div
className={clsx('cluster', className)}
data-space={space}
data-justify={justify}
data-align={align}
>
{children}
</div>
);
}
// Usage
<Cluster space="sm" justify="space-between">
<Tag>React</Tag>
<Tag>TypeScript</Tag>
<Tag>CSS</Tag>
</Cluster>
Sidebar
Two-column layout with a sidebar that stacks below breakpoint.
CSS
.with-sidebar {
display: flex;
flex-wrap: wrap;
gap: var(--sidebar-gap, 1rem);
}
.with-sidebar > :first-child {
flex-basis: var(--sidebar-width, 20rem);
flex-grow: 1;
}
.with-sidebar > :last-child {
flex-basis: 0;
flex-grow: 999;
min-inline-size: var(--sidebar-content-min, 50%);
}
/* Sidebar on right */
.with-sidebar[data-side="right"] {
flex-direction: row-reverse;
}
React Component
interface SidebarProps {
sideWidth?: string;
contentMin?: string;
gap?: string;
side?: 'left' | 'right';
children: React.ReactNode;
}
export function Sidebar({
sideWidth = '20rem',
contentMin = '50%',
gap = '1rem',
side = 'left',
children,
}: SidebarProps) {
return (
<div
className="with-sidebar"
style={{
'--sidebar-width': sideWidth,
'--sidebar-content-min': contentMin,
'--sidebar-gap': gap,
} as React.CSSProperties}
data-side={side}
>
{children}
</di
Установить layout-primitives в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл layout-primitives?
Builds composable layout components (Stack, Cluster, Grid, Sidebar, Center, Cover). Use when creating layout systems, spacing compositions, or Every Layout-style intrinsic design patterns that adapt without breakpoints.
Как установить скилл layout-primitives?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл layout-primitives запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic