Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { Carousel } from '@dryui/ui';
</script>

<Carousel.Root>
  <Carousel.Viewport>...</Carousel.Viewport>
  <Carousel.Slide>...</Carousel.Slide>
  <Carousel.Prev>...</Carousel.Prev>
  <Carousel.Next>...</Carousel.Next>
  <Carousel.Dots>...</Carousel.Dots>
  <Carousel.Thumbnails>...</Carousel.Thumbnails>
</Carousel.Root>

Import options

Root package

ts
import { Carousel } from '@dryui/ui'

Per-component subpath

ts
import { Carousel } from '@dryui/ui/carousel'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Default

svelte
<Carousel.Root>
  <Carousel.Viewport>
    {#each slides as slide}
      <Carousel.Slide>
        <div class="carousel-slide">{slide}</div>
      </Carousel.Slide>
    {/each}
  </Carousel.Viewport>
  <Carousel.Prev />
  <Carousel.Next />
  <Carousel.Dots />
</Carousel.Root>

Loop

Autoplay

svelte
<Carousel.Root autoplay={3000} loop>
  <Carousel.Viewport>
    {#each slides as slide}
      <Carousel.Slide>...</Carousel.Slide>
    {/each}
  </Carousel.Viewport>
  <Carousel.Dots />
</Carousel.Root>

Structure

Compound components always start with Carousel.Root. Use this structure block to understand required wrappers before you wire state or styling.

Carousel.Root
  Carousel.Viewport
  Carousel.Slide
  Carousel.Prev
  Carousel.Next
  Carousel.Dots
  Carousel.Thumbnails
Carousel.Root Carousel.ViewportCarousel.SlideCarousel.PrevCarousel.NextCarousel.DotsCarousel.Thumbnails

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with Carousel.Root, then add only the parts you need.

Carousel.ViewportCarousel.SlideCarousel.PrevCarousel.NextCarousel.DotsCarousel.Thumbnails

Carousel.Root

Prop Type Default Required Bindable
orientation
horizontalvertical
loop
boolean
autoplay
number | false
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Carousel.Viewport

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Carousel.Slide

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Carousel.Prev

Prop Type Default Required Bindable
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.

Carousel.Next

Prop Type Default Required Bindable
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.

Carousel.Dots

Prop Type Default Required Bindable

Forwards <div> attributes via rest props. Common examples: id, style, role.

Carousel.Thumbnails

Prop Type Default Required Bindable
position
bottomleftright
children
Snippet<[{ index: number; isActive: boolean; scrollTo: (index: number) => void }]>

Forwards <div> attributes via rest props. Common examples: id, style, role. Omitted: children.