diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts index 89355581f9..2e732467e8 100644 --- a/packages/core/src/components.d.ts +++ b/packages/core/src/components.d.ts @@ -413,6 +413,7 @@ declare global { round?: boolean; size?: 'small' | 'default' | 'large'; strong?: boolean; + type?: string; } } } diff --git a/packages/core/src/components/button/button.tsx b/packages/core/src/components/button/button.tsx index de6e739897..1d8da5f8e3 100644 --- a/packages/core/src/components/button/button.tsx +++ b/packages/core/src/components/button/button.tsx @@ -15,6 +15,13 @@ export class Button { @State() keyFocus: boolean; + /** + * The type of the button. + * Possible values are: `"submit"`, `"reset"` and `"button"`. + * Default value is: `"button"` + */ + @Prop() type = 'button'; + /** * Contains a URL or a URL fragment that the hyperlink points to. * If this property is set, an anchor tag will be rendered. @@ -123,8 +130,13 @@ export class Button { 'focused': this.keyFocus }; + const attrs = (TagType === 'button') + ? {type: 'button'} + : {}; + return (