# HorizScrollBox — SvelteKit UI

Package: sveltekit-ui 1.1.94

Page: https://www.sveltekit-ui.com/components/horiz_scroll_box

Category: Foundations

A horizontally scrollable container with optional left and right scroll arrows. Supports dynamic content and smooth scrolling interactions.

Public component import: `HorizScrollBox`

## Usage

```svelte
<script>
  // Import the shared stylesheet once in your application's root layout.
  import "sveltekit-ui/style.css"
  import { HorizScrollBox } from "sveltekit-ui"
</script>

<div style="max-width: 40rem;">
  <HorizScrollBox aria_label="Project stages">
    <div style="display: flex; gap: 1rem;">
      {#each ["Plan", "Design", "Build", "Test", "Launch"] as stage}
        <div class="card" style="min-width: 14rem; padding: 2rem;">{stage}</div>
      {/each}
    </div>
  </HorizScrollBox>
</div>
```

## Properties

### `children`

- type: snippet
- default: null
- description: Content to be displayed within the scrollable area.

### `container_width`

- type: number
- default: null
- description: Width of the container. Automatically bound to the container's offsetWidth.

### `content_width`

- type: number
- default: null
- description: Width of the scrollable content. Automatically bound to the content's clientWidth.

### `show_left_arrow`

- type: boolean
- default: false
- description: Indicates whether the left scroll arrow is visible. Automatically calculated based on scroll position.

### `show_right_arrow`

- type: boolean
- default: false
- description: Indicates whether the right scroll arrow is visible. Automatically calculated based on scroll position and content width.

### `left_arrow_color`

- type: CSS color
- default: var(--g8-t)
- description: Base color of the left arrow icon. Changes to `var(--g4-t)` when hovered or active.

### `right_arrow_color`

- type: CSS color
- default: var(--g8-t)
- description: Base color of the right arrow icon. Changes to `var(--g4-t)` when hovered or active.

### `arrow_icon_size`

- type: number
- default: 1.2
- description: Size of the left and right arrow icons in rem.

### `arrow_icon_stroke_width`

- type: number
- default: 50
- description: Stroke width of the left and right arrow icons.

### `scroll_speed`

- type: number
- default: 0.5
- description: Speed of the continuous scroll when holding down an arrow.
