{
  "tag": "ed-format-bytes",
  "kind": "component",
  "summary": "Formats a number as a human readable bytes value.",
  "status": "experimental",
  "since": "1.0",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-bytes/",
  "usage": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-bytes/usage/",
  "playwright": "getByTestId('…')",
  "dependencies": [],
  "use": [
    "Wherever a byte count meets the user — upload and attachment lists, download sizes, storage quotas, size columns in tables",
    "Showing the size next to each attachment in a document list, so users see how large a file is before opening it",
    "A size column in a table of uploaded documents, readable without counting digits"
  ],
  "notFor": [
    {
      "when": "A value whose exact byte count matters — it rounds to three significant digits",
      "instead": "the precise value with [Format Number](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-number)"
    },
    {
      "when": "Plain numbers, amounts, or percentages",
      "instead": "[Format Number](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-number)"
    }
  ],
  "rules": [
    {
      "id": "format-bytes/raw-byte-count",
      "rule": "Never assemble a file-size string by hand or divide by 1024 — pass the raw byte count straight from the API and let the component pick the unit and rounding.",
      "why": "A hand-built \"12,5 MB\" hardcodes one locale's separators, one rounding rule, and one unit convention. The component uses decimal units and localized separators and formats a size the same way everywhere in the product; a second convention next to it drifts apart.",
      "check": "warning"
    },
    {
      "id": "format-bytes/byte-unit",
      "rule": "Keep the default byte unit, and switch to bit only where the domain genuinely speaks in bits, such as network throughput. Never mix bytes and bits within one view.",
      "check": "error"
    },
    {
      "id": "format-bytes/one-display-per-view",
      "rule": "Keep one display form per view, so sizes stay comparable.",
      "why": "Mixing \"MB\" and \"megabytes\" in one list reads as noise.",
      "check": "error"
    }
  ],
  "api": {
    "attributes": [
      {
        "name": "value",
        "property": "value",
        "type": "number",
        "default": "0",
        "description": "The number to format in bytes. A value that is not a finite number renders nothing."
      },
      {
        "name": "unit",
        "property": "unit",
        "type": "'byte' | 'bit'",
        "default": "'byte'",
        "description": "The type of unit to display."
      },
      {
        "name": "display",
        "property": "display",
        "type": "'short' | 'long' | 'narrow'",
        "default": "'short'",
        "description": "Determines how to display the result, e.g. \"100 bytes\", \"100 b\", or \"100b\"."
      },
      {
        "name": "dir",
        "property": "dir",
        "type": "string"
      },
      {
        "name": "lang",
        "property": "lang",
        "type": "string"
      }
    ],
    "properties": [],
    "methods": [],
    "events": [],
    "slots": [],
    "cssProperties": [],
    "parts": [],
    "states": []
  },
  "import": "import '@eurodata/eurodata-ui/dist/components/format-bytes/format-bytes.js';",
  "react": {
    "component": "EdFormatBytes",
    "import": "import EdFormatBytes from '@eurodata/eurodata-ui/dist/react/format-bytes/index.js';"
  }
}
