Skip to content

Button

A customizable button component with various styles and states.

Importing

ts
import "@tapsioss/web-components/button/standard";
ts
import { Button } from "@tapsioss/react-components/Button";

Component Usage

html
<tapsi-button></tapsi-button>
tsx
<Button />

Properties

NameDescriptionTypeDefault Value
disabledWhether the button is disabled.booleanfalse
typeThe type of the button."button" | "submit" | "reset"-
labelThe accessible label for the button.string-
loadingWhether the button is in a loading state.booleanfalse
sizeThe size of the button."sm" | "md" | "lg""md"
variantThe variant style of the button."primary" | "ghost" | "naked" | "elevated" | "destructive" | "brand""primary"
hrefThe URL that the link button points to.string""
downloadThe filename to use when downloading the linked resource. If not specified, the browser will determine a filename. This is only applicable when the button is used as a link (href is set).string""
targetWhere to display the linked href URL for a link button. Common options include _blank to open in a new tab."_blank" | "_parent" | "_self" | "_top" | """"
autofocusIndicates that the element should be focused on page load. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocusbooleanfalse

Slots

NameDescription
-Button's content.

TIP

You can use slot names as variables:

ts
import { Slots } from "@tapsioss/web-components/button/standard";

console.log(Slots.DEFAULT); // ""
ts
import { ButtonSlots } from "@tapsioss/react-components";

console.log(ButtonSlots.DEFAULT); // ""