Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro
Common patterns

Carousels, galleries, and before/after comparisons

Carousel for rotators and galleries; CompareImage for draggable A/B sliders.
Updated 19d ago
Documentation code blocks with live preview
Date pickers and scheduling
5 min · Pattern
Carousel handles galleries, auto-play, and touch swipe; CompareImage adds a draggable before/after slider — both compose with Media and RevealFx.

When to use which

Goal
Component
Notes
Image gallery or hero rotator`Carousel`Line or thumbnail indicators, optional auto-play
Before/after or A-B comparison`CompareImage`Draggable clip-path divider
Single responsive asset`Media`Used inside both components
Marketing scroll strip`AutoScroll` / `Swiper`Continuous motion, not paginated slides
media-and-uploads covers file picking — this page covers display patterns for portfolios, product shots, and case studies.

Carousel basics

items is an array of { slide, alt? }. Each slide can be an image URL string or a custom React node. Key props:
Prop
Values
Use
`indicator``"line"`, `"thumbnail"`, `false`Dot strip vs thumb strip vs none
`play.auto`booleanStart auto-advance on mount
`play.interval`ms (default 3000)Time per slide
`play.progress`booleanShow fill bar during interval
`revealedByDefault`booleanSkip entrance animation
`aspectRatio`e.g. `"16/9"`Lock frame size
Carousel preloads the next slide, supports touch swipe, and wraps RevealFx for slide transitions. Thumbnail mode scrolls a Scroller row beneath the main frame.

CompareImage slider

Pass leftContent and rightContent, each { src, alt? }. src can be an image URL or a custom node for live UI comparison (e.g. light vs dark theme screenshot). aspectRatio defaults to "16/9". The handle is keyboard-accessible — drag updates a clip-path on both sides. Use for: design iterations, photo editing demos, layout before/after, accessibility contrast checks.

Composition tips

  • Wrap both components in a Column surface panel (background="surface", radius="l", border="neutral-alpha-weak") so they match card patterns elsewhere
  • Keep alt text on every image slide — Carousel forwards it to Media
  • Prefer play.auto only above the fold; below-fold carousels should wait for user interaction
  • Pair CompareImage with a short Heading + Text caption explaining what each side shows

Indicator control pattern

When you need a compact toggle between line and thumbnail modes, use SegmentedControl in the page chrome — wire its value to the carousel prop.
indicator

Write this / not this

✅ Once UI way
❌ Common mistake
`Carousel` with `items` + `indicator`Third-party slider with custom CSS
`CompareImage` for A/B shotsTwo static images side by side
`aspectRatio` on both componentsUnsized images jumping layout
`alt` on every slideDecorative images with empty alt everywhere

Check yourself

  • Carousel items length matches indicator count
  • Auto-play disabled or pausable on long galleries
  • CompareImage both sides share the same aspect ratio
  • Custom slide nodes still fit inside the frame (fill behavior)

Related

→ Media & uploads → Hero section → Reveal & motion → Full reference: docs.once-ui.com — Carousel
SegmentedControl buttons: Dots (line) | Thumbs (thumbnail)
onToggle → set indicator prop on Carousel