Button
Buttons let users perform actions instantly, such as submitting forms, navigating pages, or triggering app functions. Built with comprehensive state management and semantic color coding, they communicate purpose and priority while maintaining consistent behavior across desktop and mobile environments.
import {Button} 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
<Button emphasis="primary" startIcon={ExternalLink} variant="fill">
Action
</Button>
<Button emphasis="primary" startIcon={ExternalLink} variant="outline">
Action
</Button>
<Button emphasis="primary" startIcon={ExternalLink} variant="ghost">
Action
</Button>
Emphasis
Control the visual emphasis with different colors: neutral, primary, and danger.
Qualcomm
Neutral
Primary
Danger
<Button emphasis="neutral" startIcon={ExternalLink} variant="fill">
Action
</Button>
<Button emphasis="primary" startIcon={ExternalLink} variant="fill">
Action
</Button>
<Button emphasis="danger" startIcon={ExternalLink} variant="fill">
Action
</Button>
Sizes and Icons
Control dimensions with the size prop. Icons are supplied using the startIcon and endIcon props.
Qualcomm
<Button
emphasis="primary"
size="sm"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
<Button
emphasis="primary"
size="md"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
<Button
emphasis="primary"
size="lg"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
Compact Density
Use the density prop to reduce the padding and height of the button. The options are default and compact.
Qualcomm
<Button
density="compact"
emphasis="primary"
size="sm"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
<Button
density="compact"
emphasis="primary"
size="md"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
<Button
density="compact"
emphasis="primary"
size="lg"
startIcon={ExternalLink}
variant="fill"
>
Action
</Button>
Variant Combinations
Qualcomm
FillOutlineGhost
<Button emphasis="neutral" variant="fill">
Action
</Button>
<Button emphasis="neutral" variant="outline">
Action
</Button>
<Button emphasis="neutral" variant="ghost">
Action
</Button>
<Button emphasis="primary" variant="fill">
Action
</Button>
<Button emphasis="primary" variant="outline">
Action
</Button>
<Button emphasis="primary" variant="ghost">
Action
</Button>
<Button emphasis="danger" variant="fill">
Action
</Button>
<Button emphasis="danger" variant="outline">
Action
</Button>
<Button emphasis="danger" variant="ghost">
Action
</Button>
<Button disabled variant="fill">
Action
</Button>
<Button disabled variant="outline">
Action
</Button>
<Button disabled variant="ghost">
Action
</Button>
Contrast Colors
Qualcomm
<div className="bg-persistent-black flex gap-8 rounded-md p-3">
<Button emphasis="white-persistent" variant="fill">
Action
</Button>
<Button emphasis="white-persistent" variant="outline">
Action
</Button>
<Button emphasis="white-persistent" variant="ghost">
Action
</Button>
</div>
<div className="bg-persistent-white flex gap-8 rounded-md p-3">
<Button emphasis="black-persistent" variant="fill">
Action
</Button>
<Button emphasis="black-persistent" variant="outline">
Action
</Button>
<Button emphasis="black-persistent" variant="ghost">
Action
</Button>
</div>
API
<Button>
| Prop | Type | Default |
|---|---|---|
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' |
| LucideIcon | ||
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' |
| LucideIcon | ||
The style variant of the button. Governs colors. | | 'fill' | 'fill' |
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
| LucideIcon
| ReactNode
Description
Icon positioned after the text content. If supplied as a
LucideIcon, the size will automatically match the size prop.
Supply as a ReactElement for additional customization.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
| LucideIcon
| ReactNode
Description
Icon positioned before the text content. If supplied as a
LucideIcon,
the size will automatically match the size prop. Supply as a
ReactElement for additional customization.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-kind | 'text' |
data-part | 'root' |
data-scope | 'button' |
data-size | | 'sm' |
data-variant | | 'fill' |
classNameValue
'qui-button__root'data-densityValue
| 'default'
| 'compact'
data-disabledValue
data-kindValue
'text'data-partValue
'root'data-scopeValue
'button'data-sizeValue
| 'sm'
| 'md'
| 'lg'
data-variantValue
| 'fill'
| 'ghost'
| 'outline'
Start Icon
Provided via the startIcon prop.
| Attribute / Property | Value |
|---|---|
className | 'qui-button__icon' |
data-density | | 'default' |
data-part | 'icon' |
data-placement | 'start' |
data-scope | 'button' |
data-size | | 'sm' |
classNameValue
'qui-button__icon'data-densityValue
| 'default'
| 'compact'
data-partValue
'icon'data-placementValue
'start'data-scopeValue
'button'data-sizeValue
| 'sm'
| 'md'
| 'lg'
End Icon
Provided via the endIcon prop.
| Attribute / Property | Value |
|---|---|
className | 'qui-button__icon' |
data-density | | 'default' |
data-part | 'icon' |
data-placement | 'end' |
data-scope | 'button' |
data-size | | 'sm' |
classNameValue
'qui-button__icon'data-densityValue
| 'default'
| 'compact'
data-partValue
'icon'data-placementValue
'end'data-scopeValue
'button'data-sizeValue
| 'sm'
| 'md'
| 'lg'
<button>element by default.