Components / Metrics
File size
A byte count as people read it: 25 MB, 1,5 kB.
@fabrials/ui
- 812 B812 B
- 1.5 kB1,5 kB
- 25 MB25 MB
- Unknown size
Installation
Import the control from
@fabrials/ui, after setting the app up.TypeScript import { FileSize, formatBytes } from "@fabrials/ui";
API reference
| Prop / export | Type | Description |
|---|---|---|
bytes | number | null | undefined | The count. An unknown or invalid value renders the fallback, never throws. |
locale | string | Language of the number and unit. |
formatBytes(locale, bytes) | string | The plain function: 1024 steps, short units, throws a RangeError for a negative or non-finite count. |
Behavior
Tabular and unbroken, with the exact count in the title.
Accessibility
Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.