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 {ButtonModule} from "@qualcomm-ui/angular/button"Examples
Variants
Buttons come in three variants: fill, outline, and ghost. Customize these with the variant property.
<button
emphasis="primary"
q-button
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
emphasis="primary"
q-button
startIcon="ExternalLink"
variant="outline"
>
Action
</button>
<button
emphasis="primary"
q-button
startIcon="ExternalLink"
variant="ghost"
>
Action
</button>
Emphasis
Buttons can have different emphasis which affects the color of the button.
<button
emphasis="neutral"
q-button
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
emphasis="primary"
q-button
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
emphasis="danger"
q-button
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
Sizes and Icons
Customize size using the size property. QUI buttons come with built-in support for lucide-react icons.
<button
emphasis="primary"
q-button
size="sm"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
emphasis="primary"
q-button
size="md"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
emphasis="primary"
q-button
size="lg"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
Compact Density
Use the density property to reduce the padding and height of the button. The options are default and compact.
<button
density="compact"
emphasis="primary"
q-button
size="sm"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
density="compact"
emphasis="primary"
q-button
size="md"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
<button
density="compact"
emphasis="primary"
q-button
size="lg"
startIcon="ExternalLink"
variant="fill"
>
Action
</button>
Variant Combinations
This grid shows all button combinations across variants and emphasis levels. The bottom row demonstrates the disabled state, which grays out the button regardless of variant or emphasis.
<button emphasis="primary" q-button variant="fill">Action</button>
<button emphasis="primary" q-button variant="outline">Action</button>
<button emphasis="primary" q-button variant="ghost">Action</button>
<button emphasis="neutral" q-button variant="fill">Action</button>
<button emphasis="neutral" q-button variant="outline">Action</button>
<button emphasis="neutral" q-button variant="ghost">Action</button>
<button emphasis="danger" q-button variant="fill">Action</button>
<button emphasis="danger" q-button variant="outline">Action</button>
<button emphasis="danger" q-button variant="ghost">Action</button>
<button disabled emphasis="danger" q-button variant="fill">Action</button>
<button disabled emphasis="danger" q-button variant="outline">
Action
</button>
<button disabled emphasis="danger" q-button variant="ghost">
Action
</button>
Contrast Colors
Use white-persistent for buttons on dark backgrounds and black-persistent for buttons on light backgrounds. These emphasis values maintain consistent contrast regardless of the active theme.
<div class="bg-persistent-black flex gap-8 rounded-md p-3">
<button emphasis="white-persistent" q-button variant="fill">
Action
</button>
<button emphasis="white-persistent" q-button variant="outline">
Action
</button>
<button emphasis="white-persistent" q-button variant="ghost">
Action
</button>
</div>
<div class="bg-persistent-white flex gap-8 rounded-md p-3">
<button emphasis="black-persistent" q-button variant="fill">
Action
</button>
<button emphasis="black-persistent" q-button variant="outline">
Action
</button>
<button emphasis="black-persistent" q-button variant="ghost">
Action
</button>
</div>
Inverse Contrast
To flip contrast against the active theme, set emphasis to inverse.
<button emphasis="inverse" q-button variant="fill">Action</button>
<button emphasis="inverse" q-button variant="outline">Action</button>
<button emphasis="inverse" q-button variant="ghost">Action</button>
Menu Button
For a button that opens a dropdown, use q-menu-button for a labeled trigger or q-menu-icon-button for an icon-only trigger.
Split Button
For a button that pairs a primary action with a dropdown of related actions, use q-menu-split-button.
API
q-button
| 'default'
| 'compact'
booleantrue, pointer/focus
events are blocked, and the component is visually dimmed.| 'neutral'
| 'primary'
| 'danger'
| 'white-persistent'
| 'black-persistent'
| 'inverse'
| LucideIconData
| string
<svg q-end-icon icon="..."></svg>
| 'sm'
| 'md'
| 'lg'
| LucideIconData
| string
<svg q-start-icon icon="..."></svg>
| 'fill'
| 'ghost'
| 'outline'