---
title: Components
description: Using Statue's pre-built components
order: 2
icon: components
---
# Components
Statue includes a library of pre-built Svelte components for building your pages quickly. All components are themeable and responsive.
> **Built a useful component?** Contribute it back to Statue and help the community! It only takes one command. **[Contribute a component →](https://github.com/accretional/statue/blob/main/ADDING_COMPONENTS.md)**
## Importing Components
Import components from the `statue-ssg` package:
```svelte
```
## Essential Components
### NavigationBar
Top navigation with logo, links, and mobile menu.
```svelte
```
**Props:**
- `navbarItems` (array) - Navigation links
- `name` (string) - Unique identifier
- `title` (string) - Display text
- `url` (string) - Link URL
- `activePath` (string) - Current page path (for highlighting)
---
### Hero
Landing page hero section with title and description.
```svelte
```
**Props:** None (content is built-in, customize by forking the component)
---
### Categories
Display content directories as cards.
```svelte
```
**Props:**
- `directories` (array) - Directory list
- `title` (string) - Display name
- `url` (string) - Directory URL
- `name` (string) - Directory identifier
---
### LatestContent
Shows recent content as cards.
```svelte
```
**Props:**
- `rootContent` (array) - Content items
- `url` (string) - Content URL
- `metadata` (object)
- `title` (string) - Content title
- `description` (string, optional) - Description
- `date` (string, optional) - Publication date
---
### Footer
Site footer with sitemap and social links.
```svelte
```
**Props (all optional):**
- `directories` (array) - Site directories for sitemap
- `currentPath` (string) - Current page path
- `copyrightText` (string) - Copyright notice
- `legalLinks` (array) - Legal page links
- `socialLinks` (array) - Social media links
---
## Page Components
### PageHero
Page title section for internal pages.
```svelte
```
**Props:**
- `title` (string, required) - Page title
- `description` (string, optional) - Subtitle
---
### ContentHeader
Title and metadata for content pages.
```svelte
```
**Props:**
- `title` (string, required) - Page title
- `date` (string, optional) - Publication date
- `author` (string, optional) - Author name
- `backLink` (string, optional) - Back button URL
- `backLinkText` (string, optional) - Back button text
---
### ContentBody
Renders HTML content from markdown.
```svelte
```
**Props:**
- `content` (string, required) - HTML string to render
---
## Directory Components
### DirectoryHeader
Header for directory listing pages.
```svelte
```
**Props:**
- `title` (string, required) - Directory name
---
### SubDirectories
Grid of subdirectory cards.
```svelte
```
**Props:**
- `subDirectories` (array) - Subdirectory list
- `title` (string) - Display name
- `url` (string) - Subdirectory URL
---
### DirectoryContent
Content cards for directory pages.
```svelte
```
**Props:**
- `content` (array) - Content items
- `showDirectory` (boolean, optional) - Show directory badges
- `emptyMessage` (string, optional) - Message when no content
---
## Utility Components
### Warning
Info/warning/error callout box.
```svelte
```
**Props:**
- `warning` (object)
- `type` (string) - `'info'`, `'warning'`, `'error'`, or `'success'`
- `title` (string, optional) - Heading
- `message` (string, optional) - Message text
---
### Stats
Three-column statistics display.
```svelte
```
**Props:** None (customize by forking)
---
### CTA
Call-to-action section with buttons.
```svelte
```
**Props:**
- `title` (string) - CTA heading
- `description` (string) - CTA text
- `primaryButtonText` (string) - Primary button label
- `primaryButtonLink` (string) - Primary button URL
- `secondaryButtonText` (string) - Secondary button label
- `secondaryButtonLink` (string) - Secondary button URL
---
### LinkPreview
Hover preview for links showing live iframe content. Purely frontend - no backend required.
```svelte
Check out the Getting Started guide.
```
**Props:**
- `href` (string, required) - URL to link to
- `delay` (number, default: 300) - Delay in ms before showing
---
## About Page Components
### Mission
Mission statement section.
```svelte
```
**Props:** None (customize by forking)
---
### Team
Team members grid.
```svelte
```
**Props:**
- `teamMembers` (array)
- `name` (string) - Person's name
- `role` (string) - Job title
- `initials` (string) - Avatar initials
---
### WhyChooseUs
Features/benefits grid.
```svelte
```
**Props:**
- `features` (array)
- `title` (string) - Feature name
- `description` (string) - Feature description
---
## Advanced Components
### BuiltBy
"Built by" credit component.
```svelte
```
**Props (all optional):**
- `builtByText`, `builtByLinkText`, `builtByLinkUrl`
- `builtInText`, `builtInLinkText`, `builtInLinkUrl`
- `builtForText`, `communityLinkText`, `communityLinkUrl`
---
### CollapsibleTree
Recursive tree view for nested data.
```svelte
```
**Props:**
- `items` (array) - Tree structure
- `id` (string) - Unique identifier
- `label` (string) - Display text
- `badge` (string, optional) - Badge text
- `children` (array, optional) - Nested items
- `title` (string, optional) - Tree title
---
### TagList
Display clickable tag badges for blog posts.
```svelte
```
**Props:**
- `tags` (string[]) - Array of tag names
Tags link to `/tags/tag-name` pages automatically.
---
## Creating Custom Components
Create your own components in `src/lib/components/`:
```svelte
{title}
{#if content}
{content}
{/if}
```
Then use it:
```svelte
```
## Component Best Practices
### 1. Use Theme Variables
Always use CSS custom properties for colors:
```svelte
```
### 2. Make Components Responsive
Test on mobile, tablet, and desktop:
```svelte
```
### 3. Provide Sensible Defaults
Make optional props have good defaults:
```svelte
```
### 4. Document Your Props
Add JSDoc comments for custom components:
```svelte
```
## Full Component Reference
For complete component documentation with all props and examples:
**[Components README →](https://github.com/accretional/statue/blob/main/src/lib/components/COMPONENTS_README.md)**
## Next Steps
- **[Themes](./themes.md)** - Style components with themes
- **[Get Started](./get-started.md)** - Build pages with components
- **[Site Config](./site-config.md)** - Configure component data sources
**Resources:**
- **[Statue.dev](https://statue.dev)** - Official documentation