Svelte Box - Bitblue

Scrollable content container with optional padding, radius, background, and shadow

Box is a full-height, scrollable shell used inside layouts, drawers, and panels. It accepts standard div HTML attributes plus visual toggles.

Setup

<script lang="ts">
	import { Box } from '.';
</script>

Default

Scrollable line 1

Scrollable line 2

Scrollable line 3

Scrollable line 4

Scrollable line 5

Scrollable line 6

Scrollable line 7

Scrollable line 8

Scrollable line 9

Scrollable line 10

<script lang="ts">
	import { Box } from '.';
</script>

<div class="h-40 border border-gray-200">
	<Box>
		{#each Array(10) as _, i}
			<p>Scrollable line {i + 1}</p>
		{/each}
	</Box>
</div>

With padding, radius, and shadow

Panel content

Enable padding, rounded, bgWhite, and shadow for a card-like shell.

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

<script lang="ts">
	import { Box } from '.';
</script>

<div class="h-44 border border-gray-200">
	<Box padding bgWhite rounded shadow>
		<p>Panel content</p>
		{#each Array(6) as _, i}
			<p>Line {i + 1}</p>
		{/each}
	</Box>
</div>

Extra classes

Pass layout utilities through otherClasses (or native class via rest attributes when needed).

Dashed border via otherClasses.

<Box padding rounded bgWhite otherClasses="border border-dashed border-gray-300">
	<p>Dashed border via otherClasses.</p>
</Box>

Composition

Box only wraps children — nest typography, lists, forms, or tables inside it. Overflow is vertical (overflow-y-auto) with full width/height.

Props

PropTypeDefaultDescription
childrenSnippet—Content inside the scroll area
paddingbooleanfalseApply p-6
roundedbooleanfalseApply rounded-[5px]
bgWhitebooleanfalseWhite background
shadowbooleanfalseSoft gray shadow
otherClassesstring''Extra class names merged onto the root
...restHTMLAttributes<HTMLDivElement>—Passed to the root div

© 2026 Bitblue is a registered trademark. All Rights Reserved.