Component Patterns
← OverviewSteps — Multi-step Wizard
Navigate a wizard with hx-get on Next/Prev buttons. Server tracks current step and returns the updated steps indicator + content via hx-target swap.
- Details
- Preferences
- Review
- Confirm
Step 1: Details
Enter your basic information. Name, email, and preferences.
Tabs — Lazy-loaded Content
Each tab button uses hx-get to fetch content on demand. Active class managed via HyperScript.
Toast — OOB Notifications
Button posts an action; server returns a result fragment plus an OOB toast via hx-swap-oob. Toast auto-dismisses with HyperScript.
Chat Bubbles — Message Append
Form uses hx-post with hx-swap="beforeend" to append messages. The server returns both user and bot bubbles.
Swap — Animated Toggle
Each button uses hx-post with hx-swap="outerHTML" to toggle state. Server returns the updated button reflecting new state.
Skeleton — Loading Placeholder
Button fires hx-get; server delays 1.5s to simulate load. DaisyUI skeleton classes show placeholders, then real content replaces them.
Timeline — Infinite Scroll
Sentinel div at the bottom uses hx-trigger="intersect once" to load more items. Each batch includes a new sentinel until all items are loaded.
- Event 1Description for event 1
- Event 2Description for event 2
- Event 3Description for event 3
- Event 4Description for event 4
- Event 5Description for event 5
- Loading more…
Drawer — On-demand Side Panel
Open button uses hx-get to load content into the drawer body. DaisyUI drawer toggled via checkbox + HyperScript.
Rating — Star Input
Each star radio uses hx-post with hx-vals to post the selected rating. Server stores it and returns the updated fragment.
Steps
GET /steps/:stephx-get swaps wizard panel with updated step indicator and content.
Tabs
GET /tabs/:tabhx-get lazy-loads tab content; HyperScript manages active class.
Toast
POST /toastOOB swap injects toast notification that auto-dismisses.
Chat
POST /chathx-swap="beforeend" appends user + bot message bubbles.
Swap
POST /swap/likehx-swap="outerHTML" toggles button state with icon change.
Skeleton
GET /skeleton/content1.5s server delay shows skeleton placeholders, then real content.
Timeline
GET /timeline?after=Nhx-trigger="intersect once" loads batches on scroll.
Drawer
GET /drawer/contenthx-get loads drawer body on demand when opened.
Rating
POST /ratinghx-post with hx-vals sends star selection; server returns updated fragment.