GitHub

Format Bytes

Human-readable byte formatting with binary/decimal units and display styles.

<rhx-format-bytes>

Examples

Short (Default)

0 B 512 B 1 KB 1.5 MB 1 GB 1 TB

Long

1 byte 0 bytes 1.5 megabytes

Narrow

1KB 1.5MB

Bits

500 b 1 kb 1 Mb

Properties

Property Type Default Description
rhx-value long 0 The byte value to format
rhx-display string short Display style: short, long, narrow
rhx-unit string byte Unit type: byte (binary 1024) or bit (decimal 1000)

Accessibility

  • Renders as inline text content — screen readers read the formatted value naturally.
  • No interactive elements or ARIA attributes required.