File size: 929 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: Format Byte
description: Used to format bytes to a human-readable format
links:
  storybook: components-format-byte--basic
  ark: https://ark-ui.com/react/docs/utilities/format-byte
---

<ExampleTabs name="format-byte-basic" />

## Usage

```jsx
import { FormatByte } from "@chakra-ui/react"
```

```jsx
<FormatByte value={1000} />
```

## Examples

### Sizes

The format functions works for any size of bytes.

<ExampleTabs name="format-byte-sizes" />

### Format Bits

Use the `unit` prop to change the byte format to bits.

<ExampleTabs name="format-byte-with-unit" />

### Locale

Wrap the `FormatByte` component within the `LocaleProvider` to change the
locale.

<ExampleTabs name="format-byte-with-locale" />

### Unit Display

Use the `unitDisplay` prop to change the byte format to compact notation.

<ExampleTabs name="format-byte-with-unit-display" />

## Props

<PropTable component="Format" part="Byte" />