Use for triggering actions including submit, save, cancel, or delete.
The q2-btn element has one or more properties that support text localization. Those properties are indicated by the localizable badge in the description.
blockThe component expands to fill the width of its parent element.
disabledMarks the component as disabled and displays a not-allowed cursor on hover.
formAssociates the button with a <form> element by form ID.
hideLabelhide-labelHides the label, and assigns its value to the aria-label attribute on the <button> element.
intentIndicates the role of the component in the workflow, which will apply appropriate styling to the component.
labelDefines the text content of the button if it is not provided in the <slot> of the element.
Also used for the aria-label of the <button> element when only displaying an icon.
loadingDisplays the button with a loading spinner to indicate something is happening in the background and the user should not click again.
sizeDefines the size of q2-btn, it renders as default size if not provided.
typeThe default behavior of the button.
The q2-btn element exposes events that can be used to send and receive data from the component based on user interaction.
Emitted when the button is clicked.
anyThe q2-btn element has one slot that can be used to insert custom content into the component.
An optional slot to display a custom coin button label.
The intent attribute is used to indicate the role of the button which will affect how it is styled according to your theme.
Currently, the following themed options are supported:
If you add instances of neutral buttons to your project, it is strongly recommended that they are not added to the bottom of workflows and that they are not paired with either workflow-primary or workflow-secondary buttons.
<q2-btn intent="workflow-secondary">
Secondary button
</q2-btn>
<q2-btn intent="workflow-primary">
Primary button
</q2-btn>
<q2-btn intent="neutral">
Neutral button
</q2-btn>
You can easily add icons to your buttons in the same way you would add text. Tecton's implementation of this is pretty simple and allows you to show icons in three different ways.
Just add the q2-icon directly to the button's inner HTML.
Accessibility Requirement: When using icon-only buttons, you must provide a label attribute and set hide-label to ensure screen readers can announce the button's purpose. The label will be visually hidden but available to assistive technology.
<q2-btn intent="workflow-primary" label="Edit" hide-label>
<q2-icon type="edit"></q2-icon>
</q2-btn>
Add the q2-icon as the first element in the button's inner HTML, followed by a span containing the text to be displayed in your button.
<q2-btn intent="workflow-primary">
<q2-icon type="edit"></q2-icon>
<span>Edit</span>
</q2-btn>
Add the q2-icon as the last element in the button's inner HTML, followed by a span containing the text to be displayed in your button.
<q2-btn intent="workflow-primary">
<span>Edit</span>
<q2-icon type="edit"></q2-icon>
</q2-btn>
Note: Tecton ensures that only one icon is displayed per button.
While not recommended, it is possible to use custom icons within a q2-btn component, if the one you need is not provided by the Tecton Icon. To do so, we recommend inlining the SVG code for your icon to help take advantage of theming properties provided by Tecton, like the example below:
<q2-btn intent="workflow-primary">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
style="width: var(--tct-icon-size, 24px); height: var(--tct-icon-size, 24px); stroke: currentcolor;">
<path d="M2 22 22 2M2 13 13 2M4 2 2 4M11 22l11-11M22 20l-2 2"/>
</svg>
<span>Circle Icon Button</span>
</q2-btn>
You can use q2-btn as an unstyled semantic button. Simply omit all optional attributes such as intent, icon, badge, and block to use an unstyled q2-btn.
Some guidelines for using unstyled buttons:
q2-btn, not on the button itself.
**This will preserve the full clickable area of the button element.<q2-btn>
An unstyled q2-btn 👋
</q2-btn>
Sometimes, when you click a button, you want to navigate the user to another page instead of performing an action on the page. This component doesn't have an option to render it as a hyperlink (That's what the link component is for), but this is still achievable by using the click event handler, just like you would any other action. It looks like this:
const navigateBtn = document.querySelector("q2-btn");
navigateBtn.addEventListener("click", () => {
window.location.href = "https://google.com";
});
While this, works fine, there are some important things to note:
window.location that should be used for performing the necessary action.This page hosts the rules and guidance around placing buttons in Q2 related products, using the tecton q2-button and its many variants.
Workflows consider:

Create consistency in actions and clearly described and familiar actions on each page...

... avoid Inconsistency in the hierarchy of actions.
<q2-btn intent="workflow-primary" type="button" size="medium">My Button</q2-btn>
The primary action is the most salient action on the page.
<q2-btn intent="workflow-secondary" type="button" size="medium">My Button</q2-btn>
Secondary buttons are supporting Actions or "negative" actions
<q2-btn intent="neutral" type="button" size="medium">My Button</q2-btn>
<q2-btn intent="neutral-text" type="button" size="medium">My Button</q2-btn>
<q2-btn intent="workflow-escape" type="button" size="medium">My Button</q2-btn>
<q2-btn intent="workflow-destroy" type="button" size="medium">My Button</q2-btn>
<q2-btn type="button" size="medium" label="Edit" hide-label>
<q2-icon type="edit"></q2-icon>
</q2-btn>
label attribute with hide-label set to ensure screen readers can announce the button's purpose. Providing tooltips can also enhance accessibility for all users.label and hide-label attributes for screen reader supportChoosing between using a link or a button in web design depends on the intended action and the context it presents. Here's a breakdown:
In summary, links are generally used for navigation and textual actions, while buttons are used for interactive actions and calls to action. However, the choice should also consider usability and accessibility principles, ensuring that users can easily understand and interact with the elements on the web page.
When a screen reader user encounters a button or link, their screen reader is going to read the HTML tag and tell them if they are on a button or a link, and then read the text or aria-label for that button or link.
So for a link like this: <a href="/about">Learn More About Us</a>, a screen reader user would hear, "Link. Learn more about us." This is same even if that link were styled to look like a button (for example by adding class="button" to the link), because the screen reader is using the <a> tag to know that this is a link.
If the element was a button, like this: <button>Close Popup</button>, they would hear, "Button. Close popup."
<q2-btn intent="workflow-primary">
<q2-icon type="add">
</q2-icon>
<span>Add</span>
</q2-btn>
Decorations on buttons can help indicate the user's intent for the action. Icons can become recognizable and memorable symbols for specific actions or functions. Over time, users learn to associate specific icons with particular actions, enhancing usability and efficiency.
<q2-btn intent="workflow-primary">
<span>Options</span>
<q2-icon type="edit">
</q2-icon>
</q2-btn>
Signifiers help users understand the functionality and behavior of objects or elements, reducing cognitive load and enhancing usability.
<q2-btn type="button" intent="workflow-primary" size="medium">My button</q2-btn>
<q2-btn type="button" intent="workflow-primary" size="small">My button</q2-btn>
<q2-btn type="button" intent="workflow-primary" size="large">My button</q2-btn>
Provide clean examples of how to compose multiple components together in order to achieve a specific visual outcome that is curated and maintained by Tecton.
How to build a row of coin-style buttons that group related top-level actions like account shortcuts.
Coin buttons are circular icon-and-label buttons used for prominent shortcuts, typically along the top of a page or section. Use them to surface a small, fixed set of related actions (for example: Statements, Transfers, Settings, Sign Out).
Limit coin buttons to 3 to 5 actions per group, and give each button a distinct icon that clearly represents its action. Avoid using the same icon for multiple buttons in a single group; the visual differentiation is what makes coin buttons scannable.
A coin button takes a q2-avatar element as its child and uses intent="coin". Wrap the set in a q2-action-group so they pick up consistent spacing, alignment, and responsive behavior.
<q2-action-group>
<q2-btn intent="coin" label="Statements">
<q2-avatar icon="statements"></q2-avatar>
</q2-btn>
<q2-btn intent="coin" label="Transfers">
<q2-avatar icon="transfer"></q2-avatar>
</q2-btn>
<q2-btn intent="coin" label="Settings">
<q2-avatar icon="gear"></q2-avatar>
</q2-btn>
<q2-btn intent="coin" label="Sign Out">
<q2-avatar icon="logout"></q2-avatar>
</q2-btn>
</q2-action-group>
When to group buttons together and how to do it correctly using q2-btn and q2-action-group.
When you have two or more related actions sitting next to each other, for example a primary "Save" button next to a secondary "Cancel" button, wrap them in a q2-action-group. This gives them consistent spacing, alignment, and responsive behavior on small screens.
Avoid stacking q2-btn elements directly inside a flex or grid container without q2-action-group.
<q2-action-group>
<q2-btn intent="workflow-primary">Save</q2-btn>
<q2-btn intent="workflow-secondary">Cancel</q2-btn>
</q2-action-group>
How to build an Account List page in Tecton: a summary header and a searchable, client-filtered account list.
How to build a Bank Statement page in Tecton: a computed account summary and a q2-data-table of transactions for a statement period.
How to build an Account Settings page in Tecton: six independent settings sections covering nickname, notifications, statement delivery, card management, spending limits, and overdraft protection.
Containers that use borders, drop shadows, or background colors to indicate grouping are commonly referred to as cards. This document provides examples of how to create various card style layouts using the surface component.
End-to-end examples of common banking forms — account registration, card controls, secure message, and check deposit — built with Tecton components and the layout rules from Designing Forms.
How to build a Funds Transfer form in Tecton: a single-column transfer with rich account options, a recurrence schedule, and client-side validation.
How to build a Message Center page in Tecton: a two-panel layout with a message list on the left and a selected message detail plus response form on the right.
How to build a Profile page in Tecton: required-field validation for personal information, real-time cross-field password validation, and plain integration toggles.
The following CSS variables are available to override the default theme styles of the q2-btn component.
Many Tecton components consume other components to maintain visual and functional consistency. If you are looking for a CSS variable you think should exist but are not seeing it, it may be defined in one of the dependent components below. Either way, if you think it's something we should expose more conveniently, let us know!
This component uses other components in the Tecton library, including:
q2-loadingOther components in the Tecton library use this component, including:
q2-action-sheetq2-calendarq2-card-imageq2-carouselq2-data-tableq2-dropdownq2-editable-fieldq2-file-pickerq2-inputq2-modalq2-month-pickerq2-otpq2-paginationq2-sectionq2-stepperq2-tab-containerThe changelog provides a detailed history of new features, improvements, and bug fixes going back to Tecton 1.30.0. If the button is disabled, it indicates there have been no detectable changes since then.