Craft is a lightweight, flexible design system for building responsive layouts in React and handling prose.
Craft provides a set of layout components that make it easy to structure your pages. Here is how to use them:
// In your layout.tsx
import { Layout } from "@/components/ds";
export default function RootLayout({ children }) {
return <Layout>{children}</Layout>;
}
For individual pages, use the Section
, Container
, and Prose
components:
// In your page.tsx
import { Section, Container, Prose } from "@/components/ds";
export default function Page() {
return (
<Section>
<Container>
<Prose>
<h1>Page Title</h1>
<p>Your content here...</p>
</Prose>
</Container>
</Section>
);
}
For navigation elements, use the Nav
component:
import { Nav } from "@/components/ds";
export function Navigation() {
return (
<Nav>
<div className="flex justify-between items-center">
<div>Logo</div>
<ul className="flex gap-4">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</div>
</Nav>
);
}
HTML Attribute
h1
HTML Attribute
h2
HTML Attribute
h3
HTML Attribute
h4
HTML Attribute
h5
HTML Attribute
h6
HTML Attribute
p
Regular paragraph text.
HTML Attribute
large
Large text that's bigger than regular text.
HTML Attribute
small
HTML Attribute
ul
This is an example of an unordered list
HTML Attribute
ol
This is an example of an ordered list
HTML Attribute
dl
This is an example of a description list
HTML Attribute
blockquote
A well-known quote, contained in a blockquote element.- Source Attribution
HTML Attribute
pre
function example() {
console.log("Hello World");
}
HTML Attribute
details
Hidden content that appears when expanded.
HTML Attribute
figure
HTML Attribute
a
HTML Attribute
strong
HTML Attribute
code
Inline code element
HTML Attribute
kbd
HTML Attribute
mark
HTML Attribute
abbr
HTML Attribute
sub,sup
Text with subscript and superscript
HTML Attribute
table
Header 1 | Header 2 | Header 3 |
---|---|---|
Cell 1 | Cell 2 | Cell 3 |
Cell 4 | Cell 5 | Cell 6 |
HTML Attribute
input
HTML Attribute
textarea
HTML Attribute
select
HTML Attribute
checkbox
HTML Attribute
radio
HTML Attribute
hr
Text before horizontal rule
Text after horizontal rule
HTML Attribute
small
HTML Attribute
video
HTML Attribute
nested-lists
HTML Attribute
task-list
HTML Attribute
table-of-contents
HTML Attribute
footnotes