Inline Icon Button

Inline icon buttons provide a compact, icon-only action trigger designed for use within text content or tight spaces where a full button would be too prominent.

import {InlineIconButton} from "@qualcomm-ui/react/inline-icon-button"

Accessibility Guidelines

Icon-only buttons rely on visual cues that screen readers cannot access. Use aria-label or aria-labelledby to give every icon-only button an accessible name so its purpose is clear to assistive technologies.

Examples

Showcase

This example shows basic usage with a close icon.

<InlineIconButton aria-label="Close" icon={X} />

Variants

The emphasis prop controls button rendering. The default adapts to the current theme. Use persistent-black on light backgrounds and persistent-white on dark backgrounds.

<InlineIconButton aria-label="Close" icon={X} />
<div className="bg-persistent-white p-2">
  <InlineIconButton
    aria-label="Close"
    emphasis="persistent-black"
    icon={X}
  />
</div>
<div className="bg-persistent-black p-2">
  <InlineIconButton
    aria-label="Close"
    emphasis="persistent-white"
    icon={X}
  />
</div>

API

<InlineIconButton>

A small button with an icon that can be used to trigger an action. Typically used within input fields, menu items, or other components that require a small action button. Renders a <button> element by default.
PropTypeDefault
Lucide icon to display inside the button.
| LucideIcon
| ReactNode
The style variant of the button. Governs color. TODO: link to design system docs.
| 'neutral'
| 'persistent-white'
| 'persistent-black'
'neutral'
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the button and its icon.
| 'sm'
| 'md'
| 'lg'
'md'
The style variant of the button's icon that controls its size
  • scale: The icon size scales with the button's size
  • fixed: The icon size is constant, regardless of the button's size
| 'fixed'
| 'scale'
'fixed'
Type
| LucideIcon
| ReactNode
Description
Lucide icon to display inside the button.
Type
| 'neutral'
| 'persistent-white'
| 'persistent-black'
Description
The style variant of the button. Governs color. TODO: link to design system docs.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the button and its icon.
Type
| 'fixed'
| 'scale'
Description
The style variant of the button's icon that controls its size
  • scale: The icon size scales with the button's size
  • fixed: The icon size is constant, regardless of the button's size

Icon

The inner icon element is rendered with the icon passed to the icon prop.

Last updated on by Ryan Bower