Skip to content

Button

<ts-button> vv0.4.0

The ts-button component.

Open in Storybook for interactive demos.

<ts-button appearance="solid" size="md" variant="primary">Content</ts-button>
PropertyAttributeTypeDefaultDescription
appearanceappearance"ghost" | "link" | "outline" | "solid"'solid'The button’s visual weight / appearance.
blockblockbooleanfalseMakes the button take the full width of its container.
disableddisabledbooleanfalseRenders the button in a disabled state.
hrefhrefstring | undefinedAn optional href — renders an anchor instead of a button.
loadingloadingbooleanfalseRenders a loading spinner and disables the button.
sizesize"lg" | "md" | "sm" | "xl" | "xs"'md'The button’s size.
targettarget"_blank" | "_parent" | "_self" | "_top" | undefinedTarget attribute when href is set.
typetype"button" | "reset" | "submit"'button'The type attribute for the native button.
variantvariant"danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning"'primary'The button’s visual variant.
EventDetailBubblesComposedDescription
tsBlurvoidYesYesEmitted when the button loses focus.
tsClickvoidYesYesEmitted when the button is clicked (not fired when disabled/loading).
tsFocusvoidYesYesEmitted when the button receives focus.
NameDescription
*(default)*Default slot for button label content.
prefixContent before the label (e.g., icon).
suffixContent after the label (e.g., icon).

Use ::part() to style internal elements:

PartDescription
baseThe native button element.
labelThe label wrapper.
prefixThe prefix slot wrapper.
spinnerThe loading spinner element.
suffixThe suffix slot wrapper.
ts-button::part(base) {
/* your custom styles */
}
<ts-button appearance="solid" size="md" variant="primary">Content</ts-button>
import { TsButton } from '@tessera-ui/react';
<TsButton appearance="solid" size="md">Content</TsButton>