Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

Carousel

carousel

Navigates scroll-snap slides with arrows, dots, autoplay, looping, dragging, and keyboard controls.

Usage

Basic usage

Each top-level child is a slide; it has arrows + dots by default, can be dragged and dropped, and supports ←→ keyboard.

Limited time 3 days

618 Mid-Year Sale

Get 50 off when you spend over 300, and add platform coupons to save another 20.

Buy now →
New product launch

Summer thin and light series

Breathable and quick-drying fabric, 3 colors available, 20% off for pre-sale.

View new products →
Exclusive for members

Black Card Member Day

On the 8th of every month, member prices are as low as 50% off and points are doubled.

Open black card →
Free shipping to your home

Fresh food delivered next day

Procured directly from the origin, free nationwide cold chain delivery for orders over 99 yuan.

Shopping for fresh food →
Trade-in

Digital recycling subsidy

The maximum estimated price for an old machine is 1,200 yuan, and an additional 300 yuan will be charged for a new one.

Valuation recovery →
tsx
<Carousel className="w-96" aria-label="Homepage Promotion Banner">
  <Slide title="618 Mid-Year Sale" />
  <Slide title="Summer Thin and Light Series" />
  {/* ...more promotional spots */}
</Carousel>

Auto play + loop

autoplay automatically turns pages every 4s, loop lets the last page go back to the first one; automatically pauses when hovering/focusing.

Limited time 3 days

618 Mid-Year Sale

Get 50 off when you spend over 300, and add platform coupons to save another 20.

Buy now →
New product launch

Summer thin and light series

Breathable and quick-drying fabric, 3 colors available, 20% off for pre-sale.

View new products →
Exclusive for members

Black Card Member Day

On the 8th of every month, member prices are as low as 50% off and points are doubled.

Open black card →
Free shipping to your home

Fresh food delivered next day

Procured directly from the origin, free nationwide cold chain delivery for orders over 99 yuan.

Shopping for fresh food →
Trade-in

Digital recycling subsidy

The maximum estimated price for an old machine is 1,200 yuan, and an additional 300 yuan will be charged for a new one.

Valuation recovery →
tsx
<Carousel autoplay loop className="w-96">
  <Slide title="618 Mid-Year Sale" />
  <Slide title="Summer Thin and Light Series" />
</Carousel>

Dots only

showArrows={false} Hide the left and right arrows, leaving only the bottom dot indication.

Limited time 3 days

618 Mid-Year Sale

Get 50 off when you spend over 300, and add platform coupons to save another 20.

Buy now →
New product launch

Summer thin and light series

Breathable and quick-drying fabric, 3 colors available, 20% off for pre-sale.

View new products →
Exclusive for members

Black Card Member Day

On the 8th of every month, member prices are as low as 50% off and points are doubled.

Open black card →
Free shipping to your home

Fresh food delivered next day

Procured directly from the origin, free nationwide cold chain delivery for orders over 99 yuan.

Shopping for fresh food →
Trade-in

Digital recycling subsidy

The maximum estimated price for an old machine is 1,200 yuan, and an additional 300 yuan will be charged for a new one.

Valuation recovery →
tsx
<Carousel showArrows={false} className="w-96">
  <Slide title="618 Mid-Year Sale" />
  <Slide title="Summer Thin and Light Series" />
</Carousel>

Arrow only

showDots={false} Hide the dots and only keep the left and right switching arrows.

Limited time 3 days

618 Mid-Year Sale

Get 50 off when you spend over 300, and add platform coupons to save another 20.

Buy now →
New product launch

Summer thin and light series

Breathable and quick-drying fabric, 3 colors available, 20% off for pre-sale.

View new products →
Exclusive for members

Black Card Member Day

On the 8th of every month, member prices are as low as 50% off and points are doubled.

Open black card →
Free shipping to your home

Fresh food delivered next day

Procured directly from the origin, free nationwide cold chain delivery for orders over 99 yuan.

Shopping for fresh food →
Trade-in

Digital recycling subsidy

The maximum estimated price for an old machine is 1,200 yuan, and an additional 300 yuan will be charged for a new one.

Valuation recovery →
tsx
<Carousel showDots={false} className="w-96">
  <Slide title="618 Mid-Year Sale" />
  <Slide title="Summer Thin and Light Series" />
</Carousel>

When to use

Use Carousel for equal-width slides shown one at a time, such as a marketing banner, gallery, or feature tour. Use Card or List grid mode for a static multi-card layout.

Import

ts
import { Carousel } from "@hulianui/ui"

Props

CarouselProps inherits native div properties except onSelect and children:

NameTypeDefaultDescription
currentnumber-Controlled slide index.
defaultCurrentnumber0Initial uncontrolled index.
autoplaybooleanfalseAutoplay, forced off under reduced motion.
autoplayIntervalnumber4000Autoplay interval in milliseconds.
loopbooleanfalseReturns from the last slide to the first.
showArrowsbooleantrueShows previous and next controls.
showDotsbooleantrueShows dot indicators.
aria-labelstring"\u8f6e\u64ad"Region label; the built-in Chinese means “Carousel.”
slideClassNamestring-Class applied to every slide, useful for fixed height and radius.

Events

EventTypeDescription
onSelect(index: number) => voidCalled by arrows, dots, keyboard, autoplay, or drag settling.

Slots

SlotTypeDescription
children*ReactNodeOne top-level child per slide.

Usage notes

  • current makes the component controlled and requires onSelect; otherwise use defaultCurrent.
  • Reduced motion disables autoplay, including in accessibility and test environments.
  • Set consistent slide height through slideClassName to prevent layout jumps.
  • Runtime control labels are dynamic "\u7b2c N / M \u5f20" (“Slide N of M”), "\u4e0a\u4e00\u5f20" / "\u4e0b\u4e00\u5f20" (“Previous” / “Next”), "\u5e7b\u706f\u7247\u5bfc\u822a" (“Slide navigation”), and "\u8f6c\u5230\u7b2c N \u5f20" (“Go to slide N”).

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

Limited time 3 days

618 Mid-Year Sale

Get 50 off when you spend over 300, and add platform coupons to save another 20.

Buy now →
New product launch

Summer thin and light series

Breathable and quick-drying fabric, 3 colors available, 20% off for pre-sale.

View new products →
Exclusive for members

Black Card Member Day

On the 8th of every month, member prices are as low as 50% off and points are doubled.

Open black card →
Free shipping to your home

Fresh food delivered next day

Procured directly from the origin, free nationwide cold chain delivery for orders over 99 yuan.

Shopping for fresh food →
Trade-in

Digital recycling subsidy

The maximum estimated price for an old machine is 1,200 yuan, and an additional 300 yuan will be charged for a new one.

Valuation recovery →
<Carousel>
  <Slide title="618 Mid-Year Sale" />
  <Slide title="Summer Thin and Light Series" />
  {/* ...more promotional spots */}
</Carousel>
PreviousCardData DisplayNextVideo

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Usage notes
    • Related
  • Playground