Craft is an open-source design system for building content sites and user interfaces. It was created by Bridger Tower.
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:
npx craft-ds@latest init
or
pnpx craft-ds@latest init
Or use the Starter template at starter.bridger.to
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 layoutsThe 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 rowsAll 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:
pnpx create-next-app@latest
pnpx craft-ds@latest init
import {
Layout,
Main,
Section,
Container,
Prose,
Article,
Box,
} from "@/components/craft";
For detailed documentation and examples, visit craft.bridger.to
© 2024 Bridger Tower