Component Preview

Design System Documentation

← Back to Site

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

50 100 200 300 400 500 600 700 800 900

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

100% 80% 60% 40% 20% 10%

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

Underline Strikethrough Wavy Dotted Dashed Thick Offset

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

  1. First step
  2. Second step
  3. Third step with additional details
  4. Final step

Blockquote

Quoted text styling

"The only way to do great work is to love what you do."
— Steve Jobs

"Design is not just what it looks like and feels like. Design is how it works."

Steve Jobs

Co-founder, Apple

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

−4
1.17px (0.0731rem)
−3
1.89px (0.1181rem)
−2
3.06px (0.1913rem)
−1
4.94px (0.3088rem)
0
8.00px (0.5000rem)
1
12.94px (0.8087rem)
2
20.94px (1.3088rem)
3
33.89px (2.1181rem)
4
54.83px (3.4269rem)
5
88.71px (5.5444rem)
6
143.54px (8.9712rem)
7
232.24px (14.5150rem)
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

−4
2.53px
−3
3.38px
−2
4.50px
−1
6.00px
0
8.00px
1
10.66px
2
14.22px
3
18.95px
4
25.26px
5
33.67px
6
44.88px
7
59.83px

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)

base: default ratio: golden lh: 1.618

Golden Compact

Compact golden ratio spacing for dense interfaces

base: small ratio: golden lh: 1.5

Golden Spacious

Spacious golden ratio for premium feel

base: large ratio: golden lh: 1.75

Classic Fourth

Traditional spacing using perfect fourth ratio

base: default ratio: perfect-fourth lh: 1.5

Balanced Third

Balanced spacing using major third ratio

base: default ratio: major-third lh: 1.5

Modern √2

Mathematical spacing using √2 ratio

base: default ratio: augmented-fourth lh: 1.414

Subtle Minor

Subtle spacing progressions using minor third

base: default ratio: minor-third lh: 1.4

Open Fifth

Open, airy spacing using perfect fifth ratio

base: default ratio: perfect-fifth lh: 1.6

Fibonacci

Natural spacing following Fibonacci sequence

base: default ratio: fibonacci lh: 1.618

SaaS Modern

Optimized for SaaS dashboards and apps

base: default ratio: perfect-fourth lh: 1.5

Editorial

Optimized for long-form reading

base: default ratio: golden lh: 1.75

Portfolio

Spacious layout for visual portfolios

base: large ratio: golden lh: 1.6

E-commerce

Efficient spacing for product grids

base: default ratio: major-third lh: 1.5

Minimal

Tight, minimal spacing

base: small ratio: minor-third lh: 1.4

Luxury

Generous whitespace for premium brands

base: xlarge ratio: golden lh: 1.8

Visual Spacing Examples

How spacing affects component appearance

Padding Sizes

xs

sm

md

lg

xl

Gap Sizes (Flex)

xs
sm
md
lg
xl

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

Buttons

Button variants, sizes, and states

Button Variants

Different visual styles for buttons

View Code
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>

Button Sizes

Available size options for buttons

View Code
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
<Button size="xl">Extra Large</Button>

Buttons with Icons

Buttons can include icons for better visual hierarchy

View Code
<Button variant="primary">
  <InlineIcon name="mail" size="sm" />
  Send Email
</Button>

<Button variant="outline">
  Learn More
  <InlineIcon name="arrow-right" size="sm" />
</Button>

Icon-Only Buttons

Compact buttons with only icons

View Code
<Button variant="primary" size="icon">
  <InlineIcon name="plus" size="md" />
</Button>

Button States

Disabled and loading states

View Code
<Button disabled>Disabled</Button>
<Button class="opacity-75 cursor-wait">
  <span class="animate-spin">⟳</span>
  Loading...
</Button>

Link Buttons

Buttons that navigate to URLs

View Code
<Button href="/about" variant="primary">
  Go to About
</Button>

Full Width Buttons

Buttons that span the full container width

View Code
<Button class="w-full">Full Width Button</Button>

Variant × Size Matrix

Complete overview of all variant and size combinations

Variant / Size SMMDLGXL
primary
secondary
outline
ghost

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

Solid Soft Outline Subtle With Dot
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

Default Primary Secondary Success Warning Error Info

Soft

Default Primary Secondary Success Warning Error Info

Outline

Default Primary Secondary Success Warning Error Info

Badge Sizes

Available size options

XS SM MD LG

Status Badges

Common status indicator patterns

Active Pending Inactive Error

Badges with Icons

Badges can include icons for context

Verified In Progress Featured Alert

Dismissible Badges

Badges with close button

Design Development Marketing

Notification Badges

Numeric and dot indicators

5
99+

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

0/200

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

https://

Icons

Icon library and size presets

Icon Sizes

Available size presets from xs (12px) to 2xl (48px)

xs (12px)
sm (16px)
md (20px)
lg (24px)
xl (32px)
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

Button
button-icon
nav-icon
social-icon
feature-icon
hero-icon
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

Success
Warning
Error
Info

Navigation Icons

Icons for navigation and wayfinding

home
menu
close
chevron-down
chevron-up
chevron-left
chevron-right
arrow-left
arrow-right
external-link

Action Icons

Icons for actions and operations

search
plus
minus
check
copy
download
upload
share
edit
trash
settings
filter
refresh

Communication Icons

Icons for messaging and contact

mail
phone
message
send
bell

Social Icons

Icons for social media platforms

UI Icons

Icons for user interface elements

sun
moon
star
heart
bookmark
calendar
clock
map-pin
globe
link
lock
unlock
eye
eye-off

User & Commerce Icons

Icons for user accounts and e-commerce

user
users
user-plus
login
logout
cart
bag
credit-card
tag

Developer & Miscellaneous

Icons for development and other purposes

code
terminal
database
server
cloud
sparkles
zap
award
gift
briefcase
layers

Custom Styling

Icons can be styled with colors and CSS

text-red-500
color="#f59e0b"
strokeWidth=3
theme color
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

I'm interested in:

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 layout
  • saas-modern - Modern styling with larger fields
  • saas-compact - Smaller, space-efficient
  • saas-minimal - Minimalist design
  • saas-card - Card-wrapped form
  • saas-elegant - Premium styling

Newsletter Form Presets

  • default-inline - Horizontal layout
  • default-stacked - Vertical layout
  • minimal-icon - Compact with icon button
  • modern-card - Card with title
  • modern-floating - Pill-style inputs
  • elegant-minimal - Refined minimalist

Form Layouts

  • stacked - Vertical arrangement
  • two-column - Grid layout
  • compact - Minimal spacing
  • inline - Horizontal (newsletter)
  • card - Wrapped in card
  • minimal - Icon button style

Form Styles

  • default - Standard appearance
  • modern - Contemporary design
  • minimal - Clean, simple
  • glass - Glassmorphism effect
  • bordered - Emphasized borders
  • elegant - Premium feel

SEO Schemas

Industry-specific structured data (JSON-LD)

Industry Schema Mapping

Each industry has recommended schema types for optimal SEO

portfolio creative

Person ProfilePage CreativeWork WebSite

saas startup

SoftwareApplication Organization WebSite Product

ecommerce

Organization WebSite Product ItemList

blog magazine

WebSite Article BlogPosting Organization

agency digital

Organization ProfessionalService Service WebSite

restaurant food

Restaurant LocalBusiness WebSite

fitness health

SportsActivityLocation HealthAndBeautyBusiness LocalBusiness WebSite

photography

Person ProfilePage ImageGallery CreativeWork WebSite

consulting professional

ProfessionalService Organization Service WebSite

nonprofit

NGO Organization WebSite

real estate

RealEstateAgent LocalBusiness WebSite

education

EducationalOrganization Organization WebSite

healthcare

MedicalOrganization LocalBusiness WebSite

law legal

LegalService LocalBusiness WebSite

architecture interior

ProfessionalService Organization CreativeWork WebSite

Organization Schema

Basic organization information for search engines

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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

Generated JSON-LD
{
  "@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 description
  • image - OG image URL
  • keywords - Meta keywords (string or array)
  • canonical - Canonical URL override
  • noindex - Prevent indexing
  • nofollow - Prevent link following

Schema Props

  • type - Page type: website, article, product, profile, faq
  • industry - Industry for automatic schema selection
  • siteConfig - Site configuration for schemas
  • article - Article-specific data
  • product - Product-specific data
  • person - Person/profile data
  • faqs - FAQ questions and answers
  • breadcrumbs - Breadcrumb items
  • customSchemas - Additional custom schemas

Social Media Props

  • ogType - Open Graph type
  • ogLocale - Open Graph locale
  • ogSiteName - Site name for OG
  • twitterCard - Twitter card type
  • twitterSite - Twitter @username
  • twitterCreator - Content creator @username

Accessibility

Focus styles, ARIA patterns, and keyboard navigation

Accessibility Presets

Pre-configured accessibility settings for different use cases

Default

default

Balanced accessibility settings for most use cases

Focus: ring-offset / primary / focus-visible
Skip Links: prominent (3 links)
Motion: Respects preference / reduced

Minimal

minimal

Subtle focus indicators with minimal visual disruption

Focus: outline / auto / focus-visible
Skip Links: minimal (1 links)
Motion: Respects preference / minimal

High Contrast

high-contrast

Maximum visibility focus states for users who need them

Focus: glow / secondary / always
Skip Links: prominent (3 links)
Motion: Respects preference / none

Brand Focused

brand

Focus styles that match your brand colors

Focus: ring / primary / focus-visible
Skip Links: brand (3 links)
Motion: Respects preference / reduced

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:

top-left top-center top-right
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).

Sample Text

Black on White

Ratio: 21.00:1

Passes AAA

Sample Text

White on Black

Ratio: 21.00:1

Passes AAA

Sample Text

Gray 800 on Gray 100

Ratio: 13.34:1

Passes AAA

Sample Text

Blue 500 on White

Ratio: 3.68:1

Passes AA-large

Sample Text

Gray 500 on White

Ratio: 4.83:1

Passes AA

Sample Text

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

ArrowUp ArrowDown ArrowLeft ArrowRight

Action Keys

Enter ␣ Space Escape

Utility Keys

Tab Home End PageUp PageDown

Common Keyboard Patterns

Tab Move focus forward
Shift+Tab Move focus backward
Enter/Space Activate focused element
Esc Close modal/menu
↑↓ Navigate menu items
Home/End Jump to first/last item
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

motion-safe:* motion-reduce:* prefers-reduced-motion
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:

  1. User opens modal with Enter/Space or click
  2. Focus moves to first focusable element
  3. Tab cycles through elements, wrapping at boundaries
  4. Escape key closes modal
  5. 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"