Blocks
Copy-paste patterns built on Womp UIBlocks are larger patterns built from Womp UI components: code blocks, documentation layouts, markdown renderers and marketing sections. They are not a package. You copy the source into your project and own it from then on.
How It Works
Every block page has an Installation section with three parts:
- The npm packages the block needs. Womp UI is always one of them.
- Any other blocks it imports. Copy those first.
- The full source, read straight from this site. What you copy is exactly what these docs run on.
Put each block in its own folder under components/blocks, named after the block:
components/
blocks/
code-block/
code-block.tsx
code-block.css
markdown/
markdown.tsxBlocks that use other blocks import them by relative path, such as ../code-block/code-block. Keep the folder names and those imports work as-is.
Once copied, the code is yours. Rename it, restyle it, delete the parts you don't need. There is nothing to upgrade and no version to keep in sync.
Requirements
Blocks assume Womp UI is set up: the stylesheet imported and a Theme at the root of your app. See Installation.
A few blocks ship a CSS file next to the component. The component imports it, which works out of the box in the Next.js App Router, Vite and most modern bundlers.
Blocks marked 'use client' use state or effects. In the Next.js App Router they render as client components.
Available Blocks
| Block | Use it for |
|---|---|
| Code Block | Syntax-highlighted code with copy and collapse |
| Preview Block | A live demo and its code in one frame, with a light/dark switch |
| Markdown | Rendering markdown and MDX with Womp UI, with consistent spacing |
| Streaming Markdown | Rendering AI responses as they stream in |
| Docs Shell | The frame of a docs site: searchable sidebar and content area |
| Docs Page | A docs page with header, content column and table of contents |
| Table of Contents | An "On this page" list that tracks the heading in view |
| Page Header | Title, description, actions and tabs at the top of a page |
| Section Header | Title and actions at the top of a section |
| Hero | The opening section of a landing page |
| Footer | Site footer with brand, link groups and legal line |
| Testimonial | A customer quote with author details |
| Empty State | What to show when there is nothing to show |
| User Card | A person's avatar, name and one line about them |