Icon Button
import {IconButton} from "@qualcomm-ui/react/button"Examples
Variants
Buttons come in three variants: fill, outline, and ghost. Customize these with the variant property.
Qualcomm
Fill
Outline
Ghost
<IconButton icon={ExternalLink} variant="fill" />
<IconButton icon={ExternalLink} variant="outline" />
<IconButton icon={ExternalLink} variant="ghost" />Emphasis
Control the visual emphasis with different colors: neutral, primary, and danger. Customize these with the emphasis prop.
Qualcomm
Neutral
Primary
Danger
<IconButton emphasis="neutral" icon={ExternalLink} variant="fill" />
<IconButton emphasis="primary" icon={ExternalLink} variant="fill" />
<IconButton emphasis="danger" icon={ExternalLink} variant="fill" />Sizes and Icons
Customize size using the size property. QUI buttons come with built-in support for lucide-react icons.
Qualcomm
<IconButton
emphasis="primary"
icon={ExternalLink}
size="sm"
variant="fill"
/>
<IconButton
emphasis="primary"
icon={ExternalLink}
size="md"
variant="fill"
/>
<IconButton
emphasis="primary"
icon={ExternalLink}
size="lg"
variant="fill"
/>Compact Density
Use the density prop to reduce the padding and height of the button. The options are default and compact.
Qualcomm
<IconButton
density="compact"
emphasis="primary"
icon={ExternalLink}
size="sm"
variant="fill"
/>
<IconButton
density="compact"
emphasis="primary"
icon={ExternalLink}
size="md"
variant="fill"
/>
<IconButton
density="compact"
emphasis="primary"
icon={ExternalLink}
size="lg"
variant="fill"
/>Variant Combinations
Qualcomm
FillOutlineGhost
<IconButton emphasis="neutral" icon={Search} variant="fill" />
<IconButton emphasis="neutral" icon={Search} variant="outline" />
<IconButton emphasis="neutral" icon={Search} variant="ghost" />
<IconButton emphasis="primary" icon={Search} variant="fill" />
<IconButton emphasis="primary" icon={Search} variant="outline" />
<IconButton emphasis="primary" icon={Search} variant="ghost" />
<IconButton emphasis="danger" icon={Search} variant="fill" />
<IconButton emphasis="danger" icon={Search} variant="outline" />
<IconButton emphasis="danger" icon={Search} variant="ghost" />
<IconButton disabled icon={Search} variant="fill" />
<IconButton disabled icon={Search} variant="outline" />
<IconButton disabled icon={Search} variant="ghost" />Contrast Colors
Qualcomm
<div className="bg-persistent-black flex gap-6 p-4">
<IconButton
emphasis="white-persistent"
icon={ExternalLink}
variant="fill"
/>
<IconButton
emphasis="white-persistent"
icon={ExternalLink}
variant="outline"
/>
<IconButton
emphasis="white-persistent"
icon={ExternalLink}
variant="ghost"
/>
</div>
<div className="bg-persistent-white flex gap-6 p-4">
<IconButton
emphasis="black-persistent"
icon={ExternalLink}
variant="fill"
/>
<IconButton
emphasis="black-persistent"
icon={ExternalLink}
variant="outline"
/>
<IconButton
emphasis="black-persistent"
icon={ExternalLink}
variant="ghost"
/>
</div>API
<IconButton>
| Prop | Type | Default |
|---|---|---|
icon * lucide-react icon. Can be supplied as a
ReactElement for additional customization. | | LucideIcon | |
The density of the button. Governs padding and height. | | 'default' | 'default' |
Controls whether the component is interactive. When true, pointer/focus
events are blocked, and the component is visually dimmed. | boolean | false |
The style variant of the button. Governs colors. | | 'neutral' | 'neutral' |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement | |
The size of the component and its icons. | | 'sm' | 'md' |
The style variant of the button. Governs colors. | | 'fill' | 'fill' |
icon
*
Type
| LucideIcon
| ReactNode
Description
lucide-react icon. Can be supplied as a
ReactElement for additional customization.Type
| 'default'
| 'compact'
Description
The density of the button. Governs padding and height.
Type
booleanDescription
Controls whether the component is interactive. When
true, pointer/focus
events are blocked, and the component is visually dimmed.Type
| 'neutral'
| 'primary'
| 'danger'
| 'white-persistent'
| 'black-persistent'
Description
The style variant of the button. Governs colors.
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 component and its icons.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The style variant of the button. Governs colors.
| Attribute / Property | Value |
|---|---|
className | 'qui-button__root' |
data-density | | 'default' |
data-disabled | |
data-part | 'root' |
data-scope | 'icon-button' |
data-size | | 'sm' |
data-variant | | 'fill' |
classNameValue
'qui-button__root'data-densityValue
| 'default'
| 'compact'
data-disabledValue
data-partValue
'root'data-scopeValue
'icon-button'data-sizeValue
| 'sm'
| 'md'
| 'lg'
data-variantValue
| 'fill'
| 'ghost'
| 'outline'
<button>element by default.