diff --git a/packages/uui-button/lib/uui-button.element.ts b/packages/uui-button/lib/uui-button.element.ts index 43d2237ca..ed6ee978e 100644 --- a/packages/uui-button/lib/uui-button.element.ts +++ b/packages/uui-button/lib/uui-button.element.ts @@ -137,6 +137,15 @@ export class UUIButtonElement extends UUIFormControlMixin( @property({ type: String }) public rel?: string; + /** + * Sets the title attribute, which provides a tooltip for both button and anchor elements. + * @type {string} + * @attr + * @default '' + */ + @property({ type: String }) + public title: string = ''; + @query('#button') protected _button!: HTMLInputElement; @@ -237,6 +246,7 @@ export class UUIButtonElement extends UUIFormControlMixin( + aria-label=${ifDefined(this.label)} + title=${ifDefined(this.title === '' ? undefined : this.title)}> ${this.renderState()} ${this.renderLabel()}