Skip to main content
HomeComponentsButton
warning
This is a beta release of the Quantum web libraries
Please be careful when using them in production, as they may contain bugs, unstable breaking changes, and incomplete features.

Button

Buttons are the primary components for displaying actions on a page. They are often referenced as Call To Actions (CTA/C2A).

Filled button

Solid buttons are the main call to action on any page.

Filled action

<qtm-button variant="filled" color="primary">
Filled action
</qtm-button>

Color

Filled buttons are available in 4 colors: primary, success, warning and danger.

Primary Filled action

Success Filled action

Warning Filled action

Danger Filled action

<qtm-button variant="filled" color="primary">Primary Filled action</qtm-button>
<qtm-button variant="filled" color="success">Success Filled action</qtm-button>
<qtm-button variant="filled" color="warning">Warning Filled action</qtm-button>
<qtm-button variant="filled" color="danger">Danger Filled action</qtm-button>

Outline button

Outline buttons are for secondary call to actions on any page.

Outline action

<qtm-button variant="outline" color="primary">
Outline action
</qtm-button>

Color

Outline buttons are available in 5 colors: primary, neutral, success, warning and danger.

Primary Outline action

Neutral Outline action

Success Outline action

Warning Outline action

Danger Outline action

<qtm-button variant="outline" color="primary"
>Primary Outline action</qtm-button
>
<qtm-button variant="outline" color="neutral"
>Neutral Outline action</qtm-button
>
<qtm-button variant="outline" color="success"
>Success Outline action</qtm-button
>
<qtm-button variant="outline" color="warning"
>Warning Outline action</qtm-button
>
<qtm-button variant="outline" color="danger">Danger Outline action</qtm-button>

Ghost button

Ghost buttons are for miscellaneous actions on any page.

Ghost action

<qtm-button variant="ghost" color="primary">
Ghost action
</qtm-button>

Color

Ghost buttons are available in three colors: primary, neutral and inverted.

Primary Ghost action

<qtm-button variant="ghost" color="primary">
Primary Ghost action
</qtm-button>

Neutral Ghost action

<qtm-button variant="ghost" color="neutral">
Neutral Ghost action
</qtm-button>

Inverted Ghost action

<qtm-button variant="ghost" color="inverted">
Inverted Ghost action
</qtm-button>

Disable state

Filled action

Outline action

Primary Ghost action

Neutral Ghost action

<qtm-button variant="filled" color="primary" disabled>Filled action</qtm-button>
<qtm-button variant="outline" color="primary" disabled>
Outline action
</qtm-button>
<qtm-button variant="ghost" color="primary" disabled>
Primary Ghost action
</qtm-button>
<qtm-button variant="ghost" color="neutral" disabled>
Neutral Ghost action
</qtm-button>

Sizes

SmallMediumLargeXlarge
<qtm-button size="small">Small</qtm-button>
<qtm-button size="medium">Medium</qtm-button>
<qtm-button size="large">Large</qtm-button>
<qtm-button size="xlarge">Xlarge</qtm-button>

Type

There are three types of buttons: submit, button and reset. By default, a button component has type="submit"

Label

Button components can have text added either between the button tags or through the label attribute.

<qtm-button variant="primary" label="Primary"></qtm-button>
<qtm-button variant="outline" label="Outline"></qtm-button>
<qtm-button variant="ghost" label="Ghost"></qtm-button>

Props

You can apply any button attributes to qtm-button through props attribute.

app.component.ts
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
props = { form: 'form-id', formaction: '/submit', formmethod: 'get' };
}
app.component.html
<qtm-button id="button" label="Button with props" [props]="props"></qtm-button>

Icons

Left icon

With icon properties

With Content Projection

Button
<qtm-button label="Button" left-icon="account_circle"></qtm-button>
<qtm-button>
<qtm-icon icon="account_circle"></qtm-icon>
<qtm-typography>Button</qtm-typography>
</qtm-button>

Right icon

With icon properties

With Content Projection

Button
<qtm-button label="Button" right-icon="east"></qtm-button>
<qtm-button>
<qtm-typography>Button</qtm-typography>
<qtm-icon icon="east"></qtm-icon>
</qtm-button>

Icon button

You can wrap any QtmIcon with QtmButton to generate an icon button:

<qtm-button>
<qtm-icon icon="account_circle"></qtm-icon>
</qtm-button>

You can also import any icon that you need and wrap it with QtmButton tag to adopt the styles and behavior:

Storybook icon
<qtm-button variant="ghost">
<storybook-icon width="24" height="24" />
</qtm-button>

Custom icon

To select an appropriate icon, please consult the Icon component documentation.

Both the left icon and right icon can be either a string or having the following interface:

interface IconProps = {
icon: string,
classes?: string,
lib?: IconLibType,
size?: IconSizeType,
variant?: IconVariantType,
};

With icon properties

With Content Projection

Button
const icon={icon: 'applied_settings', lib:"business"}
<qtm-button label="Button" [left-icon]="icon"></qtm-button>

<qtm-button>
<qtm-typography>Button</qtm-typography>
<qtm-icon icon="applied_settings" lib="business"></qtm-icon>
</qtm-button>

API

Loading API documentation...

Spotted a bug, have a question, or want to suggest a new feature?

Submit an issue on GitLab