Svelte Craft is a lightweight, flexible design system for building responsive layouts in Svelte and handling prose.
Svelte Craft is a lightweight, flexible design system for building responsive layouts in Svelte 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.
npx jsrepo add --repo github/sikandarjodd/craft
The installer will:
Layout, Prose, Container, Section
Components in you projectThe root component that provides base styling and structure.
<Layout>
<!-- Your page content -->
</Layout>
The primary content area of your page. Applies typography styles without header spacing.
<Main>
<h1>Welcome</h1>
<p>This content will have typography styles applied.</p>
</Main>
A semantic section container for grouping related content.
<Section>
<h2>Features</h2>
<!-- Section content -->
</Section>
Centers content and provides consistent horizontal padding.
<Container>
<!-- Centered content with padding -->
</Container>
Applies typography and spacing styles (including header spacing), ideal for long-form content.
<Article>
<h1>Article Title</h1>
<p>Article content with proper typography and spacing.</p>
</Article>
Similar to Article but without max-width constraints and header spacing. Perfect for rich text content.
<Prose>
<!-- Rich text content -->
</Prose>
Svelte Craft provides a comprehensive typography system that handles:
Choose the right typography component for your needs:
Craft works seamlessly with your Tailwind configuration. You can customize:
All components accept a class
prop for custom styling:
<Container class="bg-gray-100 dark:bg-gray-900">
<Section class="py-12">
<h1>Custom Styled Section</h1>
</Section>
</Container>
<Layout>
<Main>
<Section>
<Container>
<h1>Page Title</h1>
<Box cols={2} gap={6}>
<!-- Content -->
</Box>
</Container>
</Section>
</Main>
</Layout>
<Article>
<h1>Article Title</h1>
<p>Introduction paragraph...</p>
<h2>Section Title</h2>
<p>Section content...</p>
<Box cols={3} gap={4}>
<!-- Grid content -->
</Box>
</Article>