diff --git a/src/app/components/button/button.ts b/src/app/components/button/button.ts index e44c9df85d0..3237ce4087c 100755 --- a/src/app/components/button/button.ts +++ b/src/app/components/button/button.ts @@ -320,6 +320,46 @@ export class Button implements AfterContentInit { * @group Props */ @Input() loadingIcon: string | undefined; + /** + * Add a shadow to indicate elevation. + * @group Props + */ + @Input() raised: boolean = false; + /** + * Add a circular border radius to the button. + * @group Props + */ + @Input() rounded: boolean = false; + /** + * Add a textual class to the button without a background initially. + * @group Props + */ + @Input() text: boolean = false; + /** + * Add a plain textual class to the button without a background initially. + * @group Props + */ + @Input() plain: boolean = false; + /** + * Defines the style of the button. + * @group Props + */ + @Input() severity: 'secondary' | 'success' | 'info' | 'warning' | 'help' | 'danger' | string | undefined; + /** + * Add a border class without a background initially. + * @group Props + */ + @Input() outlined: boolean = false; + /** + * Add a link style to the button. + * @group Props + */ + @Input() link: boolean = false; + /** + * Defines the size of the button. + * @group Props + */ + @Input() size: 'small' | 'large' | undefined; /** * Inline style of the element. * @group Props @@ -393,7 +433,16 @@ export class Button implements AfterContentInit { 'p-button-vertical': (this.iconPos === 'top' || this.iconPos === 'bottom') && this.label, 'p-disabled': this.disabled || this.loading, 'p-button-loading': this.loading, - 'p-button-loading-label-only': this.loading && !this.icon && this.label && !this.loadingIcon && this.iconPos === 'left' + 'p-button-loading-label-only': this.loading && !this.icon && this.label && !this.loadingIcon && this.iconPos === 'left', + 'p-button-link': this.link, + [`p-button-${this.severity}`]: this.severity, + 'p-button-raised': this.raised, + 'p-button-rounded': this.rounded, + 'p-button-text': this.text, + 'p-button-outlined': this.outlined, + 'p-button-sm': this.size === 'small', + 'p-button-lg': this.size === 'large', + 'p-button-plain': this.plain }; } diff --git a/src/app/showcase/doc/apidoc/index.json b/src/app/showcase/doc/apidoc/index.json index 34c7f685c92..940d29058f2 100644 --- a/src/app/showcase/doc/apidoc/index.json +++ b/src/app/showcase/doc/apidoc/index.json @@ -4251,7 +4251,7 @@ "name": "severity", "optional": false, "readonly": false, - "type": "\"success\" | \"warning\" | \"danger\" | \"info\"", + "type": "\"success\" | \"warning\" | \"info\" | \"danger\"", "description": "Severity type of the badge." } ] @@ -4287,7 +4287,7 @@ "name": "severity", "optional": false, "readonly": false, - "type": "\"success\" | \"warning\" | \"danger\" | \"info\"", + "type": "\"success\" | \"warning\" | \"info\" | \"danger\"", "description": "Severity type of the badge." }, { @@ -4588,6 +4588,68 @@ "type": "string", "description": "Icon to display in loading state." }, + { + "name": "raised", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a shadow to indicate elevation." + }, + { + "name": "rounded", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a circular border radius to the button." + }, + { + "name": "text", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a textual class to the button without a background initially." + }, + { + "name": "plain", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a plain textual class to the button without a background initially." + }, + { + "name": "severity", + "optional": false, + "readonly": false, + "type": "string", + "description": "Defines the style of the button." + }, + { + "name": "outlined", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a border class without a background initially." + }, + { + "name": "link", + "optional": false, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "Add a link style to the button." + }, + { + "name": "size", + "optional": false, + "readonly": false, + "type": "\"small\" | \"large\"", + "description": "Defines the size of the button." + }, { "name": "style", "optional": false, diff --git a/src/app/showcase/doc/button/linkdoc.ts b/src/app/showcase/doc/button/linkdoc.ts index bfcd1cb87bb..f78aad9e69c 100644 --- a/src/app/showcase/doc/button/linkdoc.ts +++ b/src/app/showcase/doc/button/linkdoc.ts @@ -8,7 +8,7 @@ import { Code } from '../../domain/code';
A button can be rendered as a link as well.
Outlined buttons display a border without a background initially.
Raised buttons display a shadow to indicate elevation.
Text buttons can be displayed as raised for elevation.
Rounded buttons have a circular border radius.
Button provides small and large sizes as alternatives to the standard.
Custom content inside a button is defined as children.
Text buttons are displayed as textual elements.