Sections
Getting Started
Components
- DocTabs
- Callout
- ComponentPreview
- CommandMenu
- CopyButton
- DocsSidebar
- DocsTableOfContents
- PageHeader
- SiteHeader
- CopyCodeButton
- DocsCopyPage
- CodeBlockCommand
- CommandMenuItem
- CommandMenuKbd
- GitHubLink
- LucideIcon
- MainNav
- MobileNav
- ModeSwitcher
- PageHeaderDescription
- PageHeaderHeading
- SiteBody
- SiteConfig
- SiteFooter
- OgImage (Custom)
The SiteConfig component provides a button to toggle between fixed-width and full-width content layouts.
Usage
<script setup lang="ts">
import { SiteConfig } from '@/components/SiteConfig'
</script>
<template>
<SiteConfig />
</template>Features
- Toggles between "fixed" and "full" layout modes
- Persists preference in cookies
- Applies layout class to document element
- Uses GalleryHorizontalIcon for visual indicator
API Reference
SiteConfig
| Prop | Type | Default | Description |
|---|---|---|---|
class | HTMLAttributes["class"] | undefined | Custom CSS classes |
Behavior
- Click to toggle: fixed → full → fixed
- Saves preference in cookie (
user-config) - Applies
layout-fixedorlayout-fullclass todocument.documentElement - Uses
useConfig()composable for state management
Layout Classes
When toggled, applies classes to the document:
layout-fixed: Constrains content widthlayout-full: Full viewport width
Customization
The layout classes can be styled in your CSS:
.layout-fixed {
/* Fixed width styles */
}
.layout-full {
/* Full width styles */
}