Component Preview
Design System Documentation
Welcome to the Component Preview
This page showcases all available component variants in the template's design system. Use this as a reference for building pages and understanding the available options.
Color Palettes
Available color palettes and their variants
Theme Colors
CSS custom properties from the current color palette
Primary
--color-primary
Secondary
--color-secondary
Accent
--color-accent
Background
--color-background
Surface
--color-surface
Border
--color-border
View Code
/* Access via CSS variables */
background-color: var(--color-background);
color: var(--color-text);
border-color: var(--color-border);
/* Or in Tailwind classes */
<div class="bg-[var(--color-surface)] text-[var(--color-text)]">
Content
</div> Text Colors
Text color variations
Text
--color-text
Primary text
Text Muted
--color-text-muted
Secondary text
Text Inverse
--color-text-inverse
Text on dark backgrounds
Semantic Colors
Status and feedback colors
Success
green-500
Warning
yellow-500
Error
red-500
Info
blue-500
Gray Scale
Neutral gray tones
Gradients
Common gradient patterns
Usage Examples
Common color application patterns
Success Message
Your action was completed successfully.
Error Message
Something went wrong. Please try again.
Warning Message
Please review before proceeding.
Info Message
Here's some helpful information.
Background
Content on background
Surface
Content on surface
Secondary
Content on secondary
Opacity Variations
Color with different opacity levels
Secondary Color Opacity
Theme Contrast
Light and dark surface examples
Light Surface
Content on light background with appropriate contrast.
Dark Surface
Content on dark background with appropriate contrast.
Typography
Typography scale and text styles
Type Scale
Heading sizes from H1 to H6
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
View Code
<h1 class="font-heading text-5xl font-bold">Heading 1</h1>
<h2 class="font-heading text-4xl font-bold">Heading 2</h2>
<h3 class="font-heading text-3xl font-semibold">Heading 3</h3>
<h4 class="font-heading text-2xl font-semibold">Heading 4</h4>
<h5 class="font-heading text-xl font-medium">Heading 5</h5>
<h6 class="font-heading text-lg font-medium">Heading 6</h6> Body Text Sizes
Paragraph text at different sizes
text-xs (12px)
The quick brown fox jumps over the lazy dog.
text-sm (14px)
The quick brown fox jumps over the lazy dog.
text-base (16px)
The quick brown fox jumps over the lazy dog.
text-lg (18px)
The quick brown fox jumps over the lazy dog.
text-xl (20px)
The quick brown fox jumps over the lazy dog.
Font Weights
Available weight variations
Thin (100)
Extra Light (200)
Light (300)
Normal (400)
Medium (500)
Semibold (600)
Bold (700)
Extra Bold (800)
Black (900)
Text Colors
Semantic text color variations
Primary text color
Muted text color
Secondary/accent color
Success text
Warning text
Error text
Info text
Line Heights
Different line height settings
leading-tight (1.25)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.
leading-normal (1.5)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.
leading-relaxed (1.625)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.
Letter Spacing
Character spacing variations
tracking-tighter
The quick brown fox
tracking-tight
The quick brown fox
tracking-normal
The quick brown fox
tracking-wide
The quick brown fox
tracking-wider
The quick brown fox
tracking-widest
The quick brown fox
Text Decorations
Underline, strikethrough, and other decorations
Text Transform
Case transformations
uppercase text
LOWERCASE TEXT
capitalize each word
Normal Case Text
Paragraph Styles
Common paragraph formatting
Lead Paragraph
This is a lead paragraph that introduces the main content. It's typically larger and more prominent than regular body text.
Body Paragraph
This is a standard body paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
Small/Caption Text
This is smaller caption or helper text, often used for descriptions, metadata, or secondary information.
Lists
Ordered and unordered lists
Unordered List
- First list item
- Second list item
- Third list item with longer text that might wrap to the next line
- Fourth list item
Ordered List
- First step
- Second step
- Third step with additional details
- Final step
Blockquote
Quoted text styling
"The only way to do great work is to love what you do."
"Design is not just what it looks like and feels like. Design is how it works."
Code
Inline and block code styling
Inline Code
Use the npm install command to install dependencies.
Code Block
const greeting = 'Hello, World!';
console.log(greeting); Spacing & Rhythm
Golden ratio based spacing scales
The Golden Ratio (φ = 1.618)
A mathematical ratio found in nature and art, creating harmonious proportions
The golden ratio (φ ≈ 1.618) creates naturally pleasing proportions. Each value in the scale is the previous value multiplied by φ, creating a sense of harmony and balance.
Formula:
value = baseUnit × φⁿ Where n is the step number
Golden Rectangle (1.618:1)
Available Ratios
Mathematical ratios from musical scales and geometry
golden
1.618
golden-inverse
0.618
minor-second
1.067
major-second
1.125
minor-third
1.200
major-third
1.250
perfect-fourth
1.333
augmented-fourth
1.414
perfect-fifth
1.500
minor-sixth
1.600
major-sixth
1.667
octave
2.000
double-octave
4.000
fibonacci
1.618
silver
2.414
plastic
1.325
Golden Ratio Scale
Spacing scale based on φ = 1.618 with base unit of 8px
View Code
import { generateGoldenScale } from '@/config';
const scale = generateGoldenScale(8); // Base 8px
// scale.values: [3.05, 4.94, 8, 12.94, 20.94, 33.89, ...]
// scale.rem: ['0.19rem', '0.31rem', '0.5rem', '0.81rem', ...] Perfect Fourth Scale (1.333)
More subtle progression, common in traditional design
Semantic Spacing Tokens
Named tokens for consistent spacing across components
Component Padding
--padding-xs 0.8087rem --padding-sm 1.3088rem --padding-md 2.1181rem --padding-lg 3.4269rem --padding-xl 5.5444rem Section Padding Y
--section-py-sm 5.5444rem --section-py-md 8.9712rem --section-py-lg 14.5150rem --section-py-xl 23.4856rem Layout
--container-padding 3.4269rem --page-margin 5.5444rem --section-gap 14.5150rem --grid-gap 3.4269rem --header-height 4rem --footer-padding 8.9712rem View Code
// Component spacing
<div class="p-[var(--padding-md)]">...</div>
<div class="gap-[var(--gap-lg)]">...</div>
// Section spacing
<section class="py-[var(--section-py-lg)]">...</section>
// Layout spacing
<main class="px-[var(--container-padding)]">...</main> Spacing Presets
Pre-configured spacing systems for different use cases
Golden Default
Harmonious spacing using the golden ratio (φ = 1.618)
Golden Compact
Compact golden ratio spacing for dense interfaces
Golden Spacious
Spacious golden ratio for premium feel
Classic Fourth
Traditional spacing using perfect fourth ratio
Balanced Third
Balanced spacing using major third ratio
Modern √2
Mathematical spacing using √2 ratio
Subtle Minor
Subtle spacing progressions using minor third
Open Fifth
Open, airy spacing using perfect fifth ratio
Fibonacci
Natural spacing following Fibonacci sequence
SaaS Modern
Optimized for SaaS dashboards and apps
Editorial
Optimized for long-form reading
Portfolio
Spacious layout for visual portfolios
E-commerce
Efficient spacing for product grids
Minimal
Tight, minimal spacing
Luxury
Generous whitespace for premium brands
Visual Spacing Examples
How spacing affects component appearance
Padding Sizes
xs
sm
md
lg
xl
Gap Sizes (Flex)
Stack Spacing (Vertical)
xs
sm
md
lg
xl
Usage Examples
How to apply spacing in your components
Using Presets
import {
applySpacingPreset,
getSectionSpacingClasses,
getStackSpacing,
} from '@/config';
// Apply a preset
const { scale, semantic, css } =
applySpacingPreset('golden-default');
// Use helper functions
<section class={getSectionSpacingClasses('lg')}>
<div class={getStackSpacing('md')}>
...
</div>
</section> CSS Variables
/* Component */
.card {
padding: var(--padding-md);
gap: var(--gap-sm);
}
/* Section */
.hero {
padding-block: var(--section-py-lg);
padding-inline: var(--section-px-md);
}
/* Layout */
.container {
padding: var(--container-padding);
gap: var(--grid-gap);
} Fluid Spacing
import { fluidSpacing } from '@/config';
// Create responsive spacing
const fluid = fluidSpacing(
16, // min: 16px
64, // max: 64px
320, // minViewport
1280 // maxViewport
);
// Result: clamp(1rem, ...)
<div style={`padding: ${fluid}`}>
...
</div> Vertical Rhythm
import {
createVerticalRhythm
} from '@/config';
const rhythm = createVerticalRhythm(1.618);
// Get lines needed for font size
const lines = rhythm.linesForFontSize(2);
// Get spacing that maintains rhythm
const spacing = rhythm.rhythmSpacing(2);
// Result: "3.236rem" Best Practices
Guidelines for using the spacing system effectively
Do
- Use semantic tokens for consistent spacing
- Choose one ratio and stick with it
- Use fluid spacing for responsive layouts
- Maintain vertical rhythm for typography
- Use preset helpers for common patterns
Avoid
- Mixing different ratio scales
- Using arbitrary pixel values
- Inconsistent spacing across components
- Ignoring semantic meaning of tokens
- Overriding scale values arbitrarily
Cards
Card layouts and styling options
Card Variants
Different visual styles for cards
Flat
Simple background, no shadow
Elevated
With shadow for depth
Outlined
Border emphasis
Glass
Glassmorphism effect
Gradient
Subtle gradient background
Filled
Solid color background
Interactive
Hover for effect
View Code
<!-- Flat -->
<div class="bg-[var(--color-surface)] p-6 rounded-xl">
Card content
</div>
<!-- Elevated -->
<div class="bg-[var(--color-surface)] p-6 rounded-xl shadow-lg">
Card content
</div>
<!-- Outlined -->
<div class="border border-[var(--color-border)] p-6 rounded-xl">
Card content
</div>
<!-- Glass -->
<div class="bg-white/10 backdrop-blur-md p-6 rounded-xl border border-white/20">
Card content
</div> Cards with Images
Different image placement options
Image Top
Common blog card layout
Image Left
Horizontal layout
Full Background
Text overlay on image
Hover Effects
Interactive hover animations
Lift
Rises on hover
Scale
Grows on hover
Glow
Glows on hover
Border Glow
Border highlights
Padding Sizes
Different internal spacing options
XS Padding (p-2)
MD Padding (p-4)
LG Padding (p-6)
XL Padding (p-8)
Border Radius
Different corner rounding options
None
MD
LG
XL
2XL
Feature Card Example
Practical example of a feature card
Lightning Fast
Optimized for performance with minimal bundle size and fast load times.
Fully Configurable
Customize every aspect of the design through our variant system.
Type Safe
Full TypeScript support with exported types for all configurations.
Badges
Badge variants and colors
Badge Variants
Different visual styles for badges
View Code
<!-- Solid -->
<span class="px-2.5 py-0.5 rounded-full text-xs font-medium bg-[var(--color-secondary)] text-white">
Badge
</span>
<!-- Soft -->
<span class="px-2.5 py-0.5 rounded-full text-xs font-medium bg-[var(--color-secondary)]/10 text-[var(--color-secondary)]">
Badge
</span>
<!-- Outline -->
<span class="px-2.5 py-0.5 rounded-full text-xs font-medium border border-[var(--color-secondary)] text-[var(--color-secondary)]">
Badge
</span> Badge Colors
Semantic color options for badges
Solid
Soft
Outline
Badge Sizes
Available size options
Status Badges
Common status indicator patterns
Badges with Icons
Badges can include icons for context
Dismissible Badges
Badges with close button
Notification Badges
Numeric and dot indicators
Form Inputs
Input fields, selects, and form controls
Input Variants
Different visual styles for inputs
View Code
<!-- Default -->
<input
type="text"
placeholder="Default input"
class="w-full px-4 py-2.5 rounded-lg bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text)] focus:border-[var(--color-secondary)] focus:ring-2 focus:ring-[var(--color-secondary)]/20"
/> Input Sizes
Available size options
Input States
Focus, error, success, and disabled states
This field is required
Looks good!
Inputs with Icons
Leading and trailing icon positions
Textarea
Multi-line text input
Select Dropdown
Single and multiple selection
Checkboxes & Radio Buttons
Selection controls
Checkboxes
Radio Buttons
Toggle Switch
On/off controls
Input Groups
Combined inputs and buttons
Links
Link styles and variants
Link Variants
Different visual styles for links
View Code
<!-- Default -->
<a href="#" class="text-[var(--color-secondary)] hover:underline">
Default Link
</a>
<!-- Underline -->
<a href="#" class="text-[var(--color-secondary)] underline hover:no-underline">
Underline Link
</a>
<!-- Subtle -->
<a href="#" class="text-[var(--color-text-muted)] hover:text-[var(--color-text)]">
Subtle Link
</a> Navigation Links
Links styled for navigation
Horizontal Navigation
Pill Navigation
Underline Navigation
Breadcrumb Links
Navigation path indicators
Footer Links
Links styled for footer sections
Resources
Icons
Icon library and size presets
Icon Sizes
Available size presets from xs (12px) to 2xl (48px)
View Code
<InlineIcon name="star" size="xs" /> <!-- 12px -->
<InlineIcon name="star" size="sm" /> <!-- 16px -->
<InlineIcon name="star" size="md" /> <!-- 20px -->
<InlineIcon name="star" size="lg" /> <!-- 24px -->
<InlineIcon name="star" size="xl" /> <!-- 32px -->
<InlineIcon name="star" size="2xl" /> <!-- 48px -->
<!-- Custom pixel size -->
<InlineIcon name="star" size={28} /> Icon Presets
Pre-configured styles for common use cases
View Code
<InlineIcon name="check" preset="button-icon" />
<InlineIcon name="home" preset="nav-icon" />
<InlineIcon name="twitter" preset="social-icon" />
<InlineIcon name="zap" preset="feature-icon" />
<InlineIcon name="check" preset="status-success" /> Status Icons
Semantic status indicators
Navigation Icons
Icons for navigation and wayfinding
Action Icons
Icons for actions and operations
Communication Icons
Icons for messaging and contact
UI Icons
Icons for user interface elements
User & Commerce Icons
Icons for user accounts and e-commerce
Developer & Miscellaneous
Icons for development and other purposes
Custom Styling
Icons can be styled with colors and CSS
View Code
<InlineIcon name="heart" class="text-red-500" />
<InlineIcon name="star" color="#f59e0b" />
<InlineIcon name="check" class="text-green-500" strokeWidth={3} /> Usage Examples
Common icon integration patterns
Feature List
- Responsive design included
- Dark mode support
- SEO optimized
Alert with Icon
Information
This is an informational message with an icon.
Stats with Icons
10K+
Users
4.9
Rating
50+
Countries
Forms
Contact and newsletter form layouts
Contact Form - Stacked Layout
Default vertical form layout
View Code
<ConfigurableContactForm
preset="saas-default"
formAction="/api/contact"
/> Contact Form - Two Column Layout
Side-by-side fields for larger screens
View Code
<ConfigurableContactForm
preset="saas-modern"
layout="two-column"
/> Contact Form - Compact Layout
Minimal spacing for embedded forms
View Code
<ConfigurableContactForm
preset="saas-compact"
layout="compact"
size="sm"
/> Contact Form - Card Layout
Form with card styling
View Code
<ConfigurableContactForm
preset="saas-card"
layout="card"
/> Newsletter Form - Inline Layout
Email and button side by side
View Code
<NewsletterForm preset="default-inline" /> Newsletter Form - Stacked Layout
Vertical arrangement for narrow spaces
View Code
<NewsletterForm
preset="default-stacked"
layout="stacked"
/> Newsletter Form - Minimal Layout
Compact with icon button
View Code
<NewsletterForm
preset="minimal-icon"
layout="minimal"
/> Newsletter Form - Card Layout
With title and description
Stay Updated
Get the latest news delivered to your inbox.
View Code
<NewsletterForm
preset="modern-card"
layout="card"
title="Stay Updated"
description="Get the latest news delivered to your inbox."
/> Newsletter Form - Floating Layout
Prominent CTA style
View Code
<NewsletterForm
preset="modern-floating"
layout="floating"
/> Newsletter Form - With Name
Collects name alongside email
View Code
<NewsletterForm
preset="default-inline"
layout="with-name"
showName={true}
/> Newsletter Form - With Preferences
Allow users to select topics
View Code
<NewsletterForm
layout="with-preferences"
preferences={[
{ id: 'news', label: 'Product news', checked: true },
{ id: 'tips', label: 'Tips & tutorials' },
{ id: 'offers', label: 'Special offers' },
]}
/> Form Styles
Different visual styles available
Modern Style
Minimal Style
Glass Style
Bordered Style
Form Sizes
Different size options
Small (sm)
Medium (md) - Default
Large (lg)
Form Configuration
Available presets and customization options
Contact Form Presets
saas-default- Standard stacked layoutsaas-modern- Modern styling with larger fieldssaas-compact- Smaller, space-efficientsaas-minimal- Minimalist designsaas-card- Card-wrapped formsaas-elegant- Premium styling
Newsletter Form Presets
default-inline- Horizontal layoutdefault-stacked- Vertical layoutminimal-icon- Compact with icon buttonmodern-card- Card with titlemodern-floating- Pill-style inputselegant-minimal- Refined minimalist
Form Layouts
stacked- Vertical arrangementtwo-column- Grid layoutcompact- Minimal spacinginline- Horizontal (newsletter)card- Wrapped in cardminimal- Icon button style
Form Styles
default- Standard appearancemodern- Contemporary designminimal- Clean, simpleglass- Glassmorphism effectbordered- Emphasized borderselegant- Premium feel
SEO Schemas
Industry-specific structured data (JSON-LD)
Industry Schema Mapping
Each industry has recommended schema types for optimal SEO
portfolio creative
saas startup
ecommerce
blog magazine
agency digital
restaurant food
fitness health
photography
consulting professional
nonprofit
real estate
education
healthcare
law legal
architecture interior
Organization Schema
Basic organization information for search engines
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Acme Digital Agency",
"url": "https://acme.example.com",
"logo": "https://acme.example.com/logo.png",
"description": "We create digital experiences that matter.",
"email": "[email protected]",
"telephone": "+1-555-123-4567",
"sameAs": [
"https://twitter.com/acme",
"https://linkedin.com/company/acme"
],
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94105",
"addressCountry": "US"
}
} View Code
<SEO
title="Our Company"
description="Company description"
siteConfig={{
name: "Company Name",
url: "https://example.com",
email: "[email protected]",
logo: "/logo.png",
socialLinks: ["https://twitter.com/company"]
}}
includeOrganizationSchema={true}
/> LocalBusiness Schema
For restaurants, stores, and local services
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Acme Restaurant",
"url": "https://acme.example.com",
"image": "https://acme.example.com/logo.png",
"description": "We create digital experiences that matter.",
"email": "[email protected]",
"telephone": "+1-555-123-4567",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94105",
"addressCountry": "US"
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "09:00",
"closes": "22:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Saturday",
"Sunday"
],
"opens": "10:00",
"closes": "23:00"
}
]
} View Code
<SEO
title="Our Restaurant"
industry="restaurant-food"
siteConfig={{
name: "Restaurant Name",
url: "https://example.com",
telephone: "+1-555-1234",
priceRange: "$$",
openingHours: [
{ days: ["Mon", "Tue"], opens: "09:00", closes: "22:00" }
]
}}
/> Article / BlogPosting Schema
For blog posts and news articles
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "How to Build Scalable Web Applications",
"datePublished": "2024-01-15T10:00:00Z",
"description": "Learn the best practices for building modern, scalable web applications.",
"image": "https://example.com/article-image.jpg",
"dateModified": "2024-01-20T14:30:00Z",
"wordCount": 2500,
"articleSection": "Technology",
"author": {
"@context": "https://schema.org",
"@type": "Person",
"name": "John Doe",
"url": "https://example.com/authors/john"
},
"publisher": {
"@context": "https://schema.org",
"@type": "Organization",
"name": "Acme Digital Agency",
"url": "https://acme.example.com",
"logo": "https://acme.example.com/logo.png"
}
} View Code
<SEO
title="Article Title"
description="Article excerpt"
type="article"
article={{
datePublished: "2024-01-15",
dateModified: "2024-01-20",
author: { name: "John Doe" },
section: "Technology"
}}
siteConfig={{
name: "Blog Name",
url: "https://blog.example.com"
}}
/> Product Schema
For e-commerce product pages
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Professional Website Template",
"description": "A modern, fully responsive website template for professionals.",
"image": [
"https://example.com/product-1.jpg",
"https://example.com/product-2.jpg"
],
"sku": "TPL-001",
"brand": {
"@type": "Brand",
"name": "TemplateFactory"
},
"offers": {
"@type": "Offer",
"price": 49,
"priceCurrency": "EUR",
"availability": "https://schema.org/InStock"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.8,
"reviewCount": 156,
"bestRating": 5,
"worstRating": 1
}
} View Code
<SEO
title="Product Name"
description="Product description"
type="product"
product={{
sku: "PRD-001",
price: 49,
currency: "EUR",
availability: "InStock",
brand: "Brand Name",
rating: 4.8,
reviewCount: 156
}}
/> Person / Profile Schema
For personal portfolios and team member pages
{
"@context": "https://schema.org",
"@type": "Person",
"name": "Jane Smith",
"image": "https://example.com/jane.jpg",
"jobTitle": "Senior UX Designer",
"description": "Creative designer with 10+ years of experience in digital products.",
"knowsAbout": [
"UX Design",
"UI Design",
"Figma",
"User Research"
],
"sameAs": [
"https://twitter.com/janesmith",
"https://dribbble.com/janesmith"
]
} View Code
<SEO
title="John Doe - Designer"
description="Creative designer portfolio"
type="profile"
person={{
name: "John Doe",
jobTitle: "UX Designer",
description: "10+ years experience",
skills: ["UX", "UI", "Figma"],
socialLinks: ["https://twitter.com/johndoe"]
}}
/> FAQ Schema
For frequently asked questions pages
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What payment methods do you accept?",
"acceptedAnswer": {
"@type": "Answer",
"text": "We accept all major credit cards, PayPal, and bank transfers."
}
},
{
"@type": "Question",
"name": "Do you offer refunds?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, we offer a 30-day money-back guarantee on all purchases."
}
},
{
"@type": "Question",
"name": "How do I get support?",
"acceptedAnswer": {
"@type": "Answer",
"text": "You can reach our support team via email at [email protected]."
}
}
]
} View Code
<SEO
title="FAQ"
type="faq"
faqs={[
{ question: "What payment methods?", answer: "We accept..." },
{ question: "Do you offer refunds?", answer: "Yes, 30-day..." },
]}
/> Breadcrumb Schema
For navigation breadcrumbs
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "Products",
"item": "https://example.com/products/"
},
{
"@type": "ListItem",
"position": 3,
"name": "Templates",
"item": "https://example.com/products/templates/"
}
]
} View Code
<SEO
title="Page Title"
breadcrumbs={[
{ name: "Home", url: "/" },
{ name: "Products", url: "/products/" },
{ name: "Current Page" }
]}
/> SEO Component Usage
Complete example with industry-specific schema
Basic Usage
---
import SEO from '@/components/common/SEO.astro';
---
<head>
<SEO
title="Page Title"
description="Page description"
/>
</head> With Industry Schema
---
import SEO from '@/components/common/SEO.astro';
---
<head>
<SEO
title="Restaurant Name"
description="Fine dining"
industry="restaurant-food"
siteConfig={{
name: "Restaurant",
url: "https://...",
telephone: "+1-555-1234"
}}
/>
</head> Blog Post
<SEO
title={post.title}
description={post.excerpt}
image={post.image}
type="article"
article={{
datePublished: post.date,
author: { name: post.author }
}}
/> Product Page
<SEO
title={product.name}
description={product.desc}
type="product"
product={{
price: product.price,
currency: "EUR",
availability: "InStock",
rating: product.rating
}}
/> SEO Component Props
All available configuration options
Basic Meta Props
title- Page title (required)description- Meta descriptionimage- OG image URLkeywords- Meta keywords (string or array)canonical- Canonical URL overridenoindex- Prevent indexingnofollow- Prevent link following
Schema Props
type- Page type: website, article, product, profile, faqindustry- Industry for automatic schema selectionsiteConfig- Site configuration for schemasarticle- Article-specific dataproduct- Product-specific dataperson- Person/profile datafaqs- FAQ questions and answersbreadcrumbs- Breadcrumb itemscustomSchemas- Additional custom schemas
Social Media Props
ogType- Open Graph typeogLocale- Open Graph localeogSiteName- Site name for OGtwitterCard- Twitter card typetwitterSite- Twitter @usernametwitterCreator- Content creator @username
Accessibility
Focus styles, ARIA patterns, and keyboard navigation
Accessibility Presets
Pre-configured accessibility settings for different use cases
Default
defaultBalanced accessibility settings for most use cases
Minimal
minimalSubtle focus indicators with minimal visual disruption
High Contrast
high-contrastMaximum visibility focus states for users who need them
Brand Focused
brandFocus styles that match your brand colors
Focus Styles
Visual indicators for keyboard focus states
Tab through the buttons below to see different focus styles. Press Tab to move forward, Shift+Tab to move backward.
outline
ring
ring-offset
glow
underline
box (inset)
focus vs focus-visible
focus-visible only shows focus styles for keyboard navigation, not mouse clicks.
View Code
import { getFocusClasses } from '@/config';
// Different focus styles
const outlineFocus = getFocusClasses({ style: 'outline' });
const ringFocus = getFocusClasses({ style: 'ring' });
const ringOffsetFocus = getFocusClasses({ style: 'ring-offset' });
const glowFocus = getFocusClasses({ style: 'glow' });
const underlineFocus = getFocusClasses({ style: 'underline' });
const boxFocus = getFocusClasses({ style: 'box' }); Skip Links
Keyboard shortcuts to bypass navigation and jump to content
Skip links are hidden until focused with Tab key. They allow keyboard users to bypass repetitive navigation.
Available Styles:
Tab to the links above to see them appear
Position Options:
View Code
import SkipLink from '@/components/common/SkipLink.astro';
// Default skip links
<SkipLink />
// Custom configuration
<SkipLink
preset="high-contrast"
links={[
{ label: 'Skip to main', target: '#main-content' },
{ label: 'Skip to search', target: '#search' },
]}
/> ARIA Patterns
Pre-defined ARIA attributes for common UI components
button
role: button
tabindex: 0
link
tabindex: 0
menuButton
aria-haspopup: menu
aria-expanded: false
menuItem
role: menuitem
tabindex: -1
dialog
role: dialog
dialogTitle
dialogDescription
tabList
role: tablist
tab
role: tab
aria-selected: false
tabindex: -1
tabPanel
role: tabpanel
tabindex: 0
accordion
accordionButton
aria-expanded: false
accordionPanel
role: region
dropdown
dropdownTrigger
aria-haspopup: listbox
aria-expanded: false
Total patterns available: 38
View Code
import { ariaPatterns, getAriaAttributes } from '@/config';
// Get ARIA attributes for a dialog
const dialogAttrs = getAriaAttributes('dialog', {
ariaLabelledBy: 'dialog-title',
ariaDescribedBy: 'dialog-description',
});
// Result: {
// role: 'dialog',
// 'aria-modal': true,
// 'aria-labelledby': 'dialog-title',
// 'aria-describedby': 'dialog-description'
// } Color Contrast
WCAG contrast ratio checker for accessibility compliance
WCAG 2.1 requires minimum contrast ratios: 4.5:1 for normal text (AA), 3:1 for large text (AA), 7:1 for normal text (AAA).
Black on White
Ratio: 21.00:1
Passes AAA
White on Black
Ratio: 21.00:1
Passes AAA
Gray 800 on Gray 100
Ratio: 13.34:1
Passes AAA
Blue 500 on White
Ratio: 3.68:1
Passes AA-large
Gray 500 on White
Ratio: 4.83:1
Passes AA
Gray 400 on White
Ratio: 2.54:1
Fails WCAG
View Code
import { getContrastRatio, meetsContrastRequirement, getContrastRating } from '@/config';
// Check contrast ratio
const ratio = getContrastRatio('#000000', '#ffffff'); // 21
// Check if it meets requirements
const meetsAA = meetsContrastRequirement('#000000', '#ffffff', 'AA'); // true
const meetsAAA = meetsContrastRequirement('#000000', '#ffffff', 'AAA'); // true
// Get rating
const rating = getContrastRating(ratio); // 'AAA' Keyboard Navigation
Standard keyboard patterns for accessible interactions
Navigation Keys
Action Keys
Utility Keys
Common Keyboard Patterns
View Code
import { keyboardKeys, keyboardHandlerScript } from '@/config';
// Use keyboard keys constant
element.addEventListener('keydown', (e) => {
if (e.key === keyboardKeys.ESCAPE) {
closeModal();
}
});
// Use KeyboardNavigation class (from script)
const nav = new KeyboardNavigation(menuElement, {
itemSelector: '[role="menuitem"]',
orientation: 'vertical',
loop: true,
}); Reduced Motion
Respecting user preferences for reduced animations
Users can enable "reduce motion" in their operating system. The template automatically respects this preference.
Normal Animation
motion-safe:animate-pulse
Reduced Motion
motion-reduce:animate-none
View Code
import { getReducedMotionClasses, generateReducedMotionCSS } from '@/config';
// Get utility classes
const classes = getReducedMotionClasses();
// Result: 'motion-safe:transition motion-reduce:transition-none ...'
// In your CSS
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
} Screen Reader Utilities
Utilities for content visible only to screen readers
Visually Hidden (.sr-only)
Content hidden visually but announced by screen readers.
Screen readers announce: "Add to cart (Product Name)"
Live Regions
Announce dynamic content changes to screen readers.
aria-live="polite" Wait for user idle aria-live="assertive" Interrupt immediately .sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
} View Code
import VisuallyHidden from '@/components/common/VisuallyHidden.astro';
import LiveRegion from '@/components/common/LiveRegion.astro';
// Visually hidden text
<VisuallyHidden>This is only read by screen readers</VisuallyHidden>
// Live region for announcements
<LiveRegion id="status" politeness="polite" />
// Announce with JavaScript
window.announce('Form submitted successfully', 'polite'); Focus Trap
Keep focus within modal dialogs and overlays
Focus trapping prevents keyboard users from accidentally leaving modal dialogs. Tab cycles through focusable elements within the container.
How it works:
- User opens modal with Enter/Space or click
- Focus moves to first focusable element
- Tab cycles through elements, wrapping at boundaries
- Escape key closes modal
- Focus returns to trigger element
Focus Trap Zone
View Code
import FocusTrap from '@/components/common/FocusTrap.astro';
// Wrap your modal content
<FocusTrap id="my-modal" active={isOpen}>
<div role="dialog" aria-modal="true">
<h2>Modal Title</h2>
<p>Modal content...</p>
<button>Close</button>
</div>
</FocusTrap>
// JavaScript control
const trap = document.getElementById('my-modal').focusTrap;
trap.activate(); // Enable trap
trap.deactivate(); // Disable trap
trap.toggle(); // Toggle state Accessibility Best Practices
Guidelines for building accessible interfaces
Do
- Use semantic HTML elements (button, nav, main, etc.)
- Provide visible focus indicators for all interactive elements
- Include skip links for keyboard navigation
- Ensure 4.5:1 contrast ratio for text
- Add ARIA labels to icon-only buttons
- Test with keyboard navigation (no mouse)
- Respect reduced motion preferences
- Use live regions for dynamic content changes
Avoid
- Removing focus outlines without alternatives
- Using color alone to convey information
- Auto-playing media without user controls
- Creating keyboard traps (except in modals)
- Using tabindex values greater than 0
- Hiding content with display:none when it should be accessible
- Relying solely on hover states for important interactions
- Using vague link text like "click here"