Skip to content

Commit 9e84130

Browse files
committed
feat(icon-button): add download attribute
1 parent 902a84f commit 9e84130

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

iconbutton/internal/icon-button.ts

+8
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
7979
*/
8080
@property() href = '';
8181

82+
/**
83+
* The filename to use when downloading the linked resource.
84+
* If not specified, the browser will determine a filename.
85+
* This is only applicable when the icon button is used as a link (`href` is set).
86+
*/
87+
@property() download = '';
88+
8289
/**
8390
* Sets the underlying `HTMLAnchorElement`'s `target` attribute.
8491
*/
@@ -191,6 +198,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
191198
class="link"
192199
id="link"
193200
href="${this.href}"
201+
download="${this.download || nothing}"
194202
target="${this.target || nothing}"
195203
aria-label="${ariaLabel || nothing}">
196204
${this.renderTouchTarget()}

0 commit comments

Comments
 (0)