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 { FormatBytes } from '@dryui/ui';
</script>

<FormatBytes>Content</FormatBytes>

Import options

Root package

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

Per-component subpath

ts
import { FormatBytes } from '@dryui/ui/format-bytes'

Customize

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

Default

1 kB
svelte
<FormatBytes value={1024} />

Various Sizes

0 byte 1 kB 1 MB 1 GB
svelte
<FormatBytes value={0} />
<FormatBytes value={1024} />
<FormatBytes value={1048576} />
<FormatBytes value={1073741824} />

Display Formats

1.5 kB 1.5 kilobytes 1.5kB
svelte
<FormatBytes value={1536} display="short" />
<FormatBytes value={1536} display="long" />
<FormatBytes value={1536} display="narrow" />

Unit

8 kB 8.2 kb
svelte
<FormatBytes value={8192} unit="byte" />
<FormatBytes value={8192} unit="bit" />

Compose

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

Prop Type Default Required Bindable
value
number
locale
string
unit
bytebit
display
shortlongnarrow

Forwards <span> attributes via rest props. Common examples: id, style, aria-label.