{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "IconButton",
  "label": "Icon button",
  "slug": "icon-button",
  "category": "actions",
  "description": "Icon-only button in primary, secondary and tertiary emphasis and a default, neutral or destructive tone, in default and compact sizes.",
  "client": false,
  "importPath": "rift-ds/components/IconButton/IconButton",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/icon-button",
  "markdownUrl": "https://rift-ds.com/components/icon-button.md",
  "exports": [
    {
      "component": "IconButton",
      "props": [
        {
          "name": "icon",
          "type": "string | ReactNode",
          "typeKind": "other",
          "required": true,
          "description": "The icon — Material Symbol name (string) or custom element (ReactNode)"
        },
        {
          "name": "variant",
          "type": "\"neutral\" | \"primary\" | \"secondary\" | \"tertiary\"",
          "typeKind": "enum",
          "values": [
            "neutral",
            "primary",
            "secondary",
            "tertiary"
          ],
          "required": false,
          "description": "Emphasis: `primary` (filled), `secondary` (outlined) or `tertiary`\n(ghost). The colour is `tone`'s job. `neutral` is the legacy value from\nbefore the split and renders as `variant=\"primary\" tone=\"neutral\"`."
        },
        {
          "name": "tone",
          "type": "\"default\" | \"destructive\" | \"neutral\"",
          "typeKind": "enum",
          "values": [
            "default",
            "destructive",
            "neutral"
          ],
          "required": false,
          "description": "Colour, independent of emphasis: `default` carries the action colour,\n`neutral` the greys, `destructive` the danger colour. Tertiary is\nalready grey, so `neutral` leaves it unchanged; a tertiary\n`destructive` takes the outlined look, since a danger action needs a\nvisible edge."
        },
        {
          "name": "priority",
          "type": "\"primary\" | \"secondary\" | \"tertiary\"",
          "typeKind": "enum",
          "values": [
            "primary",
            "secondary",
            "tertiary"
          ],
          "required": false,
          "description": "Legacy alias for `variant`.",
          "deprecated": "Use `variant` instead."
        },
        {
          "name": "disabled",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether the button is disabled"
        },
        {
          "name": "state",
          "type": "\"default\" | \"active\" | \"disabled\" | \"hover\"",
          "typeKind": "enum",
          "values": [
            "active",
            "default",
            "disabled",
            "hover"
          ],
          "required": false,
          "description": "Documentation-only interaction state.",
          "deprecated": "Use `disabled` for the disabled state.\n\nDocumentation-only affordance for rendering a *static* interaction state in\nStorybook and the showcase site. Real hover/active styling comes from CSS\npseudo-classes and needs no prop — for docs, prefer\n`className=\"ds-icon-button--hover\"`."
        },
        {
          "name": "size",
          "type": "\"default\" | \"compact\"",
          "typeKind": "enum",
          "values": [
            "compact",
            "default"
          ],
          "required": false,
          "description": "Button size",
          "default": "default"
        },
        {
          "name": "loading",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Shows a spinner in place of the icon and blocks interaction while an\nasync action runs. Keeps the variant's full-colour appearance (unlike\nthe disabled state) and sets `aria-busy` on the rendered element."
        },
        {
          "name": "glass",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Frosts the button for a busy ground (a shader, a photo, a map), as\nButton's `glass` does: the page behind it is blurred, an outlined or\nghost button takes the glass fill at rest and a filled one lets a\nlittle of the ground through its colour. Hover and press are the\nvariant's own. Works on every `variant` and `tone`."
        },
        {
          "name": "label",
          "type": "string",
          "typeKind": "primitive",
          "required": true,
          "description": "The button's name: what a screen reader announces and, by default, what\nthe tooltip shows. Required, because the button has no visible text.\nNamed as Button's and AiButton's text is, so the family spells it one way."
        },
        {
          "name": "tooltip",
          "type": "string | false",
          "typeKind": "other",
          "required": false,
          "description": "The hover/focus tooltip. An icon-only control names itself: by default\nthe button wears a Tooltip carrying `label`. Pass a string to show\ndifferent wording, or `false` to opt out — for a host that labels the\ncontrol another way, or one that owns the button's box directly\n(SplitButton's trigger stretches to its sibling segment, which the\ntooltip wrapper would block)."
        },
        {
          "name": "tooltipPosition",
          "type": "\"top\" | \"bottom\" | \"left\" | \"right\" | \"start\" | \"end\"",
          "typeKind": "enum",
          "values": [
            "bottom",
            "end",
            "left",
            "right",
            "start",
            "top"
          ],
          "required": false,
          "description": "Which side the tooltip opens on. `start` and `end` follow the reading direction.",
          "default": "top"
        },
        {
          "name": "type",
          "type": "\"button\" | \"submit\" | \"reset\"",
          "typeKind": "enum",
          "values": [
            "button",
            "reset",
            "submit"
          ],
          "required": false,
          "description": "The button's native type. Defaults to `button`, so a button inside a form\nnever submits it by accident; set `submit` on the form's submit button, or\n`reset`. Ignored when `href` renders a link.",
          "default": "button"
        },
        {
          "name": "href",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Optional href — renders as <a> instead of <button>"
        },
        {
          "name": "target",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Optional target attribute for links"
        },
        {
          "name": "rel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Optional rel attribute for links"
        },
        {
          "name": "badge",
          "type": "string | number | true",
          "typeKind": "other",
          "required": false,
          "description": "A mark on the button's top-end corner, as BottomNav draws one: a count (a notification bell's unread), or `true` for a dot with no number."
        },
        {
          "name": "badgeMax",
          "type": "number",
          "typeKind": "primitive",
          "required": false,
          "description": "The highest count the badge spells out; a larger one reads \"99+\". Defaults to 99.",
          "default": 99
        },
        {
          "name": "badgeLabel",
          "type": "((badge: string | number | true) => string)",
          "typeKind": "function",
          "required": false,
          "description": "Text read after `label` while the button carries a badge, given the\nbadge. Defaults to \", new\" for a dot and \", 3 new\" for a count; the\nleading comma and space are part of the text. The tooltip keeps\n`label` alone.",
          "defaultExpression": "(badge: number | string | true) => (badge === true ? ', new' : `, ${badge} new`)"
        },
        {
          "name": "locale",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "The BCP 47 locale a numeric badge 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": ""
        },
        {
          "name": "linkComponent",
          "type": "LinkComponent",
          "typeKind": "reference",
          "required": false,
          "description": "The component the link renders with, such as Next.js's `Link`, so it\nnavigates 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"
  },
  "keyboard": [
    {
      "pattern": "button",
      "label": "Button",
      "apg": "https://www.w3.org/WAI/ARIA/apg/patterns/button/",
      "rows": [
        {
          "keys": [
            "Enter"
          ],
          "text": "Activates the button."
        },
        {
          "keys": [
            "Space"
          ],
          "text": "Activates the button."
        }
      ]
    }
  ],
  "size": {
    "gzip": 4381
  },
  "alternatives": [
    {
      "name": "Button",
      "when": "the action needs its words on show, with or without an icon beside them",
      "schemaUrl": "https://rift-ds.com/schema/components/button.json"
    },
    {
      "name": "CopyButton",
      "when": "the button puts a value on the clipboard and should confirm it",
      "schemaUrl": "https://rift-ds.com/schema/components/copy-button.json"
    }
  ]
}
