Skip to content DS OneButton Component | DS one
DS one

Button Component

The ds-button component provides a customizable button with multiple visual variants.

<ds-button variant="primary">Click Me</ds-button>

The primary button style, used for main actions:

<ds-button variant="primary">Primary Button</ds-button>

Secondary button style for less prominent actions:

<ds-button variant="secondary">Secondary Button</ds-button>

A text-only button without a background:

<ds-button variant="text">Text Button</ds-button>
AttributeTypeDefaultDescription
variant'primary' | 'secondary' | 'text''primary'Button style variant
disabledbooleanfalseWhether the button is disabled

The button component emits standard button events:

const button = document.querySelector("ds-button");
button.addEventListener("click", (e) => {
console.log("Button clicked!");
});
<ds-button variant="primary" disabled>Disabled Button</ds-button>
<ds-button variant="primary">
<icon-v1 name="check"></icon-v1>
Save Changes
</ds-button>

The button component respects your theme’s accent color and can be customized using CSS custom properties.