{
 "id": "filter-bar",
 "name": "Filter bar",
 "purpose": "The row above a table: search, filter chips with one applied and removable, add a filter, a sort button and the number of results; on a phone the search goes full width and the chips wrap onto rows at their natural width.",
 "use_when": [
  "above a table people search, filter and sort",
  "above a list of cards or search results that people narrow by a few fields"
 ],
 "avoid_when": [
  "searching across the whole app or running commands: use command-menu",
  "only picking dates: use date-range-picker",
  "switching between views of the same page: use page-header-tabs"
 ],
 "type": "form",
 "style": "dense",
 "width": "wide",
 "tags": {
  "audience": "work",
  "industries": [
   "finance",
   "saas",
   "crm",
   "any"
  ],
  "keywords": [
   "filter",
   "search",
   "chips",
   "sort",
   "toolbar",
   "table"
  ]
 },
 "root": ".odl-filter-bar",
 "parts": [
  {
   "name": "search",
   "selector": ".odl-search input",
   "what": "the search field, with a shortcut hint",
   "slot": "input"
  },
  {
   "name": "applied",
   "selector": ".odl-active",
   "what": "an applied filter: its name and value, plus a remove button",
   "slot": "list"
  },
  {
   "name": "remove",
   "selector": ".odl-x",
   "what": "removes the applied filter it sits in",
   "slot": "action"
  },
  {
   "name": "filters",
   "selector": ".odl-filters > .odl-chip",
   "what": "one filter not yet applied, which opens its options",
   "slot": "list"
  },
  {
   "name": "add",
   "selector": ".odl-ghost",
   "what": "adds another kind of filter",
   "slot": "action"
  },
  {
   "name": "count",
   "selector": ".odl-count",
   "what": "how many results match",
   "slot": "number"
  },
  {
   "name": "sort",
   "selector": ".odl-sort",
   "what": "the current sort order, which opens a menu",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "count",
   "noun",
   "filters"
  ],
  "properties": {
   "search_placeholder": {
    "type": "string",
    "maxLength": 24,
    "part": "search"
   },
   "applied": {
    "type": "array",
    "minItems": 0,
    "maxItems": 3,
    "part": "applied",
    "items": {
     "type": "object",
     "required": [
      "name",
      "value"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 16
      },
      "value": {
       "type": "string",
       "maxLength": 16
      }
     }
    }
   },
   "filters": {
    "type": "array",
    "minItems": 1,
    "maxItems": 5,
    "part": "filters",
    "items": {
     "type": "object",
     "required": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 18
      }
     }
    }
   },
   "add_label": {
    "type": "string",
    "maxLength": 14,
    "part": "add"
   },
   "count": {
    "type": "number",
    "part": "count"
   },
   "noun": {
    "type": "string",
    "maxLength": 14,
    "part": "count"
   },
   "sort": {
    "type": "string",
    "maxLength": 18,
    "part": "sort"
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "focus",
   "filter applied",
   "filter empty",
   "removed"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if results fail to load, show 'Could not load' in place of the count and an alert-banners line under the bar"
   },
   "disabled": {
    "status": "not_built",
    "how": "while the table loads, set disabled on the filter chips and Sort and dim them"
   },
   "overflow": {
    "status": "handled",
    "how": "chips wrap onto more rows at their natural width; under 900 px they move to their own row, and on a phone the search goes full width",
    "evidence": "@container (max-width: 899.98px)"
   },
   "long_text": {
    "status": "handled",
    "how": "chip, count and sort labels never wrap; a long chip drops to its own row, so keep each label short",
    "evidence": "white-space: nowrap; cursor: pointer;"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-field",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-neutral-subtle-hover",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-input",
  "--ds-color-border-separator",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-icon-subtle",
  "--ds-color-surface-raised",
  "--ds-color-text-link",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-detail",
  "--ds-size-control-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-text-body-md",
  "--ds-text-code-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md"
 ],
 "a11y": {
  "summary": "The bar is a labelled search landmark; every chip and the sort control are buttons that say they open a popup, the remove button names the filter it clears, and the result count is a polite live region.",
  "roles": [
   "group",
   "search"
  ],
  "keyboard": [
   "Tab moves through the search field, each chip and its remove button, Add filter, then Sort",
   "Enter or Space on a remove button clears that filter, turns it back into a plain chip and moves focus to it; the new count is read out"
  ],
  "controls": {
   "button": 9,
   "input": 1,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/filter-bar/component.html",
  "bytes": 11955,
  "script": true
 },
 "source": "brand/showcase/product/01-quoin-payments",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/filter-bar.html",
  "json": "https://opendesigner.dev/library/filter-bar.json",
  "page": "https://opendesigner.dev/library/filter-bar/"
 },
 "get": {
  "curl": "curl -fsSLo filter-bar.html https://opendesigner.dev/library/filter-bar.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add filter-bar --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component filter-bar to this project: https://opendesigner.dev/library/filter-bar.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
