Craft is a lightweight, flexible design system for building responsive layouts in React and handling prose. It provides a set of foundational components that make it easy to create consistent, maintainable layouts while leveraging the power of Tailwind CSS.
To quickly get up and building with shadcn and craft use this command:
pnpx shadcn init my-app
cd my-app
pnpx craft-ds inits
To add to an existing project, use:
pnpx craft-ds init
# Using npm
npx init craft-ds
# Using pnpm (recommended)
pnpx init craft-ds
# Using yarn
yarn create craft-ds
The installer will:
The root component that provides base styling and structure for the HTML document.
import { Layout } from "@/components/craft";
export default function RootLayout({ children }) {
return <Layout>{children}</Layout>;
}
The primary content area of your page.
<Main>
<h1>Welcome</h1>
This content will be in the main section.
</Main>
A semantic section container for grouping related content with vertical padding.
<Section>
<h2>Features</h2>
{/* Section content */}
</Section>
Centers content with a maximum width and provides consistent padding.
<Container>{/* Centered content with padding */}</Container>
Creates a navigation container with an inner div for navigation elements.
<Nav>
Logo
<ul>
<li>
<a href="https://github.com/brijr/craft/raw/0.3.5/">Home</a>
</li>
<li>
<a href="https://github.com/brijr/craft/raw/0.3.5/about">About</a>
</li>
</ul>
</Nav>
A powerful component for rich text content with extensive typography styling. Can be rendered as an article element when needed.
// As a div (default)
<Prose>
<h1>Rich Text Content</h1>
Content with proper typography styling.
</Prose>
// As an article with spacing
<Prose isArticle={true} isSpaced={true}>
<h1>Article Title</h1>
Article content with proper typography and spacing.
</Prose>
All components share a common props interface:
type DSProps = {
className?: string;
children?: React.ReactNode;
id?: string;
style?: React.CSSProperties;
dangerouslySetInnerHTML?: { __html: string };
containerClassName?: string; // Used in Nav component
isArticle?: boolean; // Used in Prose component
isSpaced?: boolean; // Used in Prose component
};
The Prose component provides a comprehensive typography system that handles:
<Prose isSpaced={true}>
<h1>Main Heading</h1>
Introduction paragraph with <a href="#">links</a> and <code>inline code</code>.
<h2>Section Heading</h2>
More content with <strong>strong text</strong> and <em>emphasis</em>.
<ul>
<li>List item one</li>
<li>List item two
<ul>
<li>Nested list item</li>
</ul>
</li>
</ul>
<blockquote>
This is a blockquote with styled borders and background.
</blockquote>
<pre><code>// This is a code block
function example() {
return true;
}</code></pre>
</Prose>
Craft works seamlessly with your Tailwind configuration. You can customize:
All components accept a className prop for custom styling:
<Container className="bg-gray-100 dark:bg-gray-900">
<Section className="py-12">
<h1>Custom Styled Section</h1>
</Section>
</Container>
<Layout>
<Nav>{/* Navigation content */}</Nav>
<Main>
<Section>
<Container>
<h1>Page Title</h1>
{/* Content */}
</Container>
</Section>
</Main>
</Layout>
<Prose isArticle={true} isSpaced={true}>
<h1>Article Title</h1>
Introduction paragraph...
<h2>Section Title</h2>
Section content...
{/* Rich content with full typography styling */}
</Prose>
We welcome contributions! Please see our Contributing Guide for details.
MIT Bridger Tower 2025
$ claude mcp add craft \
-- python -m otcore.mcp_server <graph>