{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "Widget",
  "label": "Widget",
  "slug": "widget",
  "category": "data-display",
  "description": "A titled section for a dashboard or settings, with rows, groups, a footer, an optional fold, and a board of columns.",
  "client": false,
  "importPath": "rift-ds/components/Widget/Widget",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/widget",
  "markdownUrl": "https://rift-ds.com/components/widget.md",
  "exports": [
    {
      "component": "Widget",
      "props": [
        {
          "name": "title",
          "type": "string",
          "typeKind": "primitive",
          "required": true,
          "description": "The tile's heading. Also the section's accessible name, unless an `aria-label` is passed. Note: this shadows the native `title` tooltip attribute, which Widget does not expose."
        },
        {
          "name": "count",
          "type": "number",
          "typeKind": "primitive",
          "required": false,
          "description": "A quiet figure after the title: how many rows the tile holds, how many are open."
        },
        {
          "name": "action",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "Trailing header slot, opposite the title — a compact button, a link, a period label."
        },
        {
          "name": "titleAs",
          "type": "\"h2\" | \"h3\" | \"h4\"",
          "typeKind": "enum",
          "values": [
            "h2",
            "h3",
            "h4"
          ],
          "required": false,
          "description": "Heading element for the title, so the tile takes its place in the page's outline.",
          "default": "h3"
        },
        {
          "name": "description",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "A line of quieter text under the title, saying what the section holds. It also describes the section to a screen reader."
        },
        {
          "name": "footer",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "A slot under the body, behind a divider: the section's actions (Save, Cancel), a total, a link to everything."
        },
        {
          "name": "padding",
          "type": "\"none\" | \"default\" | \"compact\"",
          "typeKind": "enum",
          "values": [
            "compact",
            "default",
            "none"
          ],
          "required": false,
          "description": "The inset: `default` the tile's own, `compact` a step tighter for dense settings, `none` for a body that runs edge to edge (a table, a map) while the header and footer keep the default inset.",
          "default": "default"
        },
        {
          "name": "collapsible",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Let the reader fold the section away: the title becomes a button that shows and hides the body and footer, which leave the tab order and the accessibility tree while hidden.",
          "default": false
        },
        {
          "name": "open",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether a collapsible section is open (controlled). Pair with `onOpenChange`."
        },
        {
          "name": "defaultOpen",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether a collapsible section starts open (uncontrolled). Defaults to true.",
          "default": true
        },
        {
          "name": "onOpenChange",
          "type": "((open: boolean) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Called with the new open state when the reader folds or unfolds a collapsible section."
        },
        {
          "name": "children",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "The tile's body: WidgetRows, WidgetGroups, a chart, a figure, a form, anything."
        },
        {
          "name": "locale",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "The BCP 47 locale the count is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider.",
          "default": "en-US"
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        }
      ]
    },
    {
      "component": "WidgetGrid",
      "props": [
        {
          "name": "columns",
          "type": "1 | 2 | 3",
          "typeKind": "enum",
          "values": [
            "1",
            "2",
            "3"
          ],
          "required": false,
          "description": "The most columns the board runs to. It folds to fewer as its own width narrows.",
          "default": 2
        },
        {
          "name": "children",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "The Widgets on the board, in reading order: they fill the first column, then the next."
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        }
      ]
    },
    {
      "component": "WidgetGroup",
      "props": [
        {
          "name": "label",
          "type": "string",
          "typeKind": "primitive",
          "required": true,
          "description": "The run's quiet label, e.g. \"Waiting on you\"."
        },
        {
          "name": "children",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "The rows in this run."
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        }
      ]
    },
    {
      "component": "WidgetRow",
      "props": [
        {
          "name": "title",
          "type": "string",
          "typeKind": "primitive",
          "required": true,
          "description": "The row's main line. Note: this shadows the native `title` tooltip attribute, which WidgetRow does not expose."
        },
        {
          "name": "description",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "A quiet second line under the title: who, where, or how much."
        },
        {
          "name": "leading",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "Leading mark — a StatusDot, a PixelAvatar, an Avatar, a Spinner, an icon. Decorative unless the element names itself."
        },
        {
          "name": "meta",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "Trailing fact in the caption face: a date, an amount, a state."
        },
        {
          "name": "actions",
          "type": "ReactNode",
          "typeKind": "reference",
          "required": false,
          "description": "Controls at the row's end, after the meta: an Approve and a Decline button on a request, say. A row with actions is not itself a link or a button, since a control cannot hold others, so it takes no `href` or `onClick`."
        },
        {
          "name": "href",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Renders the row as a link to this URL."
        },
        {
          "name": "chevron",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "A trailing chevron saying the row goes somewhere, mirrored in a right-to-left context. Defaults to on for a row with `href` and off otherwise; a row whose `onClick` opens a page of its own can turn it on."
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        },
        {
          "name": "linkComponent",
          "type": "LinkComponent",
          "typeKind": "reference",
          "required": false,
          "description": "The component its links render with, such as Next.js's `Link`, so they\nnavigate through the app's router; a plain `<a>` when unset. This\ncomponent can render on the server, so it never reads a LinkProvider:\npass the prop even under one.",
          "typeRefs": [
            "LinkComponent"
          ]
        }
      ]
    }
  ],
  "types": {
    "LinkComponent": {
      "kind": "type",
      "definition": "type LinkComponent = React.ElementType<LinkComponentProps>;",
      "description": "A component that renders a link in place of a plain `<a>`, such as a router's.",
      "refs": [
        "LinkComponentProps"
      ]
    },
    "LinkComponentProps": {
      "kind": "type",
      "definition": "type LinkComponentProps = React.ComponentPropsWithRef<'a'> & { href: string };",
      "description": "The props a link component receives: every anchor attribute, the ref, and\nan `href` that is always a string. Next.js's `Link` takes these as they\nare; a router whose link takes `to` instead needs a one-line adapter:\n`({ href, ...props }) => <RouterLink to={href} {...props} />`."
    }
  },
  "externalTypes": {
    "ComponentPropsWithRef": "react",
    "ElementType": "react",
    "ReactNode": "react"
  },
  "keys": {
    "by": "none"
  },
  "size": {
    "gzip": 1780
  },
  "alternatives": [
    {
      "name": "Grid",
      "when": "cells of any kind should sit in equal columns and share a row’s height",
      "schemaUrl": "https://rift-ds.com/schema/components/grid.json"
    },
    {
      "name": "FormSection",
      "when": "the section holds a form’s fields and its own save",
      "schemaUrl": "https://rift-ds.com/schema/components/form-section.json"
    },
    {
      "name": "DecisionRow",
      "when": "each row waits on a yes or a no and settles to the answer",
      "schemaUrl": "https://rift-ds.com/schema/components/decision-row.json"
    }
  ]
}
