hydroxy

App shell

A page frame with header, navigation, main, aside and footer. The navigation sits beside the content on wide screens and becomes a native drawer on narrow ones, with a skip link and an optional fixed-height scroll mode.

Skip to content
Acme

Overview

The header, navigation, aside and footer stay put while this region scrolls.

Paragraph 1 of placeholder content to scroll.

Paragraph 2 of placeholder content to scroll.

Paragraph 3 of placeholder content to scroll.

Paragraph 4 of placeholder content to scroll.

Paragraph 5 of placeholder content to scroll.

Paragraph 6 of placeholder content to scroll.

Paragraph 7 of placeholder content to scroll.

Paragraph 8 of placeholder content to scroll.

Paragraph 9 of placeholder content to scroll.

Paragraph 10 of placeholder content to scroll.

Paragraph 11 of placeholder content to scroll.

Paragraph 12 of placeholder content to scroll.

Footer

Usage

use hydroxy_leptos::app_shell::{AppShell, ScrollMode};
use hydroxy_leptos::icon::IconName;
use hydroxy_leptos::nav_item::NavItem;
use leptos::prelude::*;

pub fn demo() -> AnyView {
    let (page, set_page) = signal("Overview");
    let item = move |label: &'static str, icon: IconName| {
        view! {
            <NavItem
                label=label
                icon=icon
                active=Signal::derive(move || page.get() == label)
                on_click=move || set_page.set(label)
            />
        }
    };

    view! {
        // The shell is a fixed 460px tall here, with only the main region scrolling.
        // Below 768px wide the navigation becomes a drawer behind the menu button.
        <div style="--ox-app-shell-nav-width: 180px; --ox-app-shell-aside-width: 150px; border: 1px solid var(--border-1); border-radius: var(--radius-md); overflow: hidden;">
            <AppShell
                scroll_mode=ScrollMode::Main
                host_block_size=460.0
                main_id="app-shell-demo-main"
                skip_label="Skip to content"
                navigation=move || view! {
                    <div style="display: grid; gap: 2px;">
                        {item("Overview", IconName::Inbox)}
                        {item("Projects", IconName::FileText)}
                        {item("Starred", IconName::Star)}
                        {item("People", IconName::User)}
                    </div>
                }
                header=move || view! { <strong style="font: var(--text-h4);">"Acme"</strong> }
                aside=move || view! { <p style="margin: 0; font: var(--text-sm); color: var(--text-2);">"Notes and activity sit in the aside."</p> }
                footer=move || view! { <span>"Footer"</span> }
            >
                <h2 style="margin: 0 0 var(--space-4); font: var(--text-h3);">{move || page.get()}</h2>
                <p style="margin: 0 0 var(--space-4); color: var(--text-2);">
                    "The header, navigation, aside and footer stay put while this region scrolls."
                </p>
                {(1..=12)
                    .map(|i| view! { <p style="margin: 0 0 var(--space-4); color: var(--text-2);">{format!("Paragraph {i} of placeholder content to scroll.")}</p> })
                    .collect_view()}
            </AppShell>
        </div>
    }
    .into_any()
}

Anatomy

Componentdata-partRenders
AppShellrootdata-scroll-mode is document or main; data-sticky-header when set
(inside)skip-linkHidden until focused. Needs main_id and skip_label together
(inside)headerHolds the menu button and your header content
(inside)menuOpens the drawer on narrow screens. aria-expanded follows it
(inside)bodyRow of navigation, main and aside
(inside)navigationA nav landmark, rendered once. A native popover on narrow screens
(inside)closeCloses the drawer
(inside)mainThe page content. Receives focus from the skip link
(inside)aside / footerOptional regions. The aside hides on narrow screens

Keyboard

KeyDoes
EscClose the drawer
TabFrom the top of the page, reaches the skip link first

Props

PropTypeNotes
navigationViewFnNavigation content, rendered once
header / aside / footerOption<ViewFn>Optional regions
navigation_openOption<bool>Controlled drawer state. Pair with on_navigation_open_change
default_navigation_openboolInitial drawer state when uncontrolled
on_navigation_open_changeCallback<(bool, NavReason)>The drawer wants to open or close, and why: Trigger or Dismiss
scroll_modeScrollModeDocument (default) or Main. Main needs host_block_size
host_block_sizeOption<f64>The shell's height in pixels for Main
sticky_headerboolKeep the header visible while the page scrolls
main_id / skip_labelOption<String>Enable the skip link. Both or neither
navigation_labelOption<String>Name of the landmark. Default Navigation
Actions
Button
Icon button
Toolbar
Theme menu
Display
Avatar
Badge
Card
Chip
Code block
Markdown
Doc card
Due pill
Kbd
Priority mark
Source chip
Space icon
Status diamond
Tag
Value diff
Carousel
Reveal
Media timeline
QR code
Transcript viewer
Audio waveform
Audio player
Forms
Calendar
Checkbox
Combobox
Date picker
Color picker
Cron builder
Theme editor
Mention input
Signature pad
Image cropper
Date field
Date range picker
Duration field
Quantity stepper
Filter chip
Input
Markdown editor
Radio group
Search field
Segmented control
Select
Slider
Range slider
Rating
Toggle button
File dropzone
Upload queue
Attachment
Switch
Tags input
Number field
Money field
Phone field
Time field
OTP input
Password field
Questionnaire
Availability picker
Voice input
Recording control
Inline edit
Async validated input
Shortcut recorder
Data
Spreadsheet grid
Week scheduler
Virtual list
Stat card
Step track
Kanban board
Sortable list
Filter builder
Data table
Grid
Access editor
File manager
Gantt chart
Log stream
Diff viewer
JSON inspector
Terminal
Node editor
Whiteboard
Navigation
Table of contents
Breadcrumb
Tabs
Wizard
Nav item
Nav section
Tree view
Pagination
Menubar
Navigation menu
Saved views
Layout
Master detail
App shell
Sidebar layout
Resizable panels
Dashboard layout
Dock layout
Feedback
Callout
Check list
Empty state
Progress bar
Toast
Approval card
Skeleton
Notification center
Bars
Bar chart
Diverging bar chart
Span chart
Pictogram chart
Stacked bar chart
Funnel chart
Bullet chart
Waffle chart
Marimekko chart
Dot plot chart
Error bar chart
Pareto chart
Waterfall chart
Lollipop chart
Grouped bar chart
Bar race chart
KPIs and frames
Chart frame
Metric card
Sparkline
Points
Scatter chart
Smith chart
Strip plot
Beeswarm chart
Parallel coordinates
Ternary chart
Bland-Altman chart
Quiver chart
Connected scatter chart
Grids and tables
Heatmap chart
Chart table
Cohort chart
Radial
Radial charts
Radar chart
Polar area chart
Stat ring
Clock chart
Spiral chart
Lines and areas
Bump chart
Slope chart
Line chart
Composed chart
Small multiples
Cycle plot chart
Horizon chart
Stacked area chart
Threshold chart
Split line chart
Linked charts
Confidence band chart
Forecast fan chart
Step chart
Range area chart
Distributions
Contour chart
Histogram
Box plot
Density chart
Ridgeline chart
Violin chart
Q-Q chart
Survival chart
ECDF chart
Raincloud plot
Forest plot
Maps
Geo map
Bubble map
Hexbin map
Cartogram
Flow map
Parts of a whole
Donut chart
Voronoi treemap
Nested donut chart
Treemap chart
Sunburst chart
Bubble pack chart
Icicle chart
Flame graph chart
Pie chart
Word cloud
Relationships
Sankey chart
Network chart
Chord chart
UpSet chart
Venn chart
Alluvial chart
Adjacency matrix chart
Dependency graph chart
Tree chart
Arc diagram
Hive plot
Edge bundling
Finance
Candlestick chart
OHLC chart
Depth chart
Renko chart
Time
Timeline chart
Calendar heatmap chart
Spectrogram chart
Marey chart
Overlays
Tour
Lightbox
Alert dialog
Command palette
Dialog
Menu
Popover
Tooltip
Sheet
Hover card
Context menu
Utilities
Pacer
Hotkeys
Disclosure
Accordion
Collapsible
Chat
Chat bubble
Voice session
Composer
Thread
Thread list
Assistant composer
Assistant MCP
Assistant modal
Assistant thread
Assistant thread list
Message scroller
Insight note
Emoji picker
Tool trace
Model picker
Citation popover
Activity
Activity feed
Comment thread
Timeline
Presence bar
Live cursors
Reaction bar
Guides
Getting started
All components
All charts