View the system at craft-ds.com
Craft is a minimalist Design System developed using a single component file paired with the best design tools for Next.js. It was created by Bridger Tower to build websites with Next.js, Tailwind, shadcn/ui, and TypeScript faster
To install Craft in your Next.js project, run:
pnpx craft-ds@latest init
# or `npx craft-ds@latest init` for npmthen add the craft.css to your Layout.tsx file:
import '@/components/craft/craft.css'now import layout components from craft, or use the classes from craft.css
import {
Layout,
Main,
Section,
Container,
Prose,
Article,
Box,
} from "@/components/craft";Craft provides several core components for building responsive layouts:
Layout: Sets up the basic HTML structure and applies global stylesMain: Main content area of the pageSection: Defines sections within the pageContainer: Contains content with a maximum width and paddingProse: Component for styling long-form content with appropriate typographyArticle: Renders articles with appropriate typography stylesBox: Flexible component for creating responsive layouts
The Box component is the heart of Craft's layout system. It provides a flexible way to create both flex and grid layouts with responsive controls:
import { Box } from "@/components/craft";
// Basic Flex Layout
<Box direction="row" wrap={true} gap={4}>
<div>Item 1</div>
<div>Item 2</div>
</Box>
// Responsive Layout
<Box
direction={{
base: "col",
md: "row"
}}
wrap={{
base: true,
md: false
}}
gap={{
base: 2,
md: 4
}}
>
<div>Item 1</div>
<div>Item 2</div>
</Box>
// Grid Layout
<Box cols={{
base: 1,
md: 2,
lg: 3
}} gap={4}>
<div>Grid Item 1</div>
<div>Grid Item 2</div>
<div>Grid Item 3</div>
</Box>direction: Control flex direction ("row" | "col")wrap: Enable/disable flex wrapgap: Set spacing between itemscols: Define grid columnsrows: Define grid rows
All props support responsive objects with breakpoints: base, sm, md, lg, xl, 2xl
Typography is handled through a modified version of Tailwind Typography. The styling is applied through the Main, Prose, or Article components.
Example: The Prose component is available for styling long-form content with appropriate typography:
import { Prose } from "@/components/craft";
<Prose>
<h1>Title</h1>
<p>Your content here...</p>
</Prose>;For font management, we recommend using Next.js Font Optimization with variable fonts.
Colors are managed using shadcn's theming system. Custom Tailwind classes like text-primary or bg-accent are defined in globals.css.
Find color schemes at:
- Create a Next.js application:
pnpx create-next-app@latest- Install Craft (this will also install shadcn/ui and dependencies):
pnpx craft-ds@latest init- Import and use Craft components:
import {
Layout,
Main,
Section,
Container,
Prose,
Article,
Box,
} from "@/components/craft";- shadcn/ui: Beautifully designed, accessible components
- React Wrap Balancer: Improves title readability
For detailed documentation and examples, visit craft.bridger.to
