Add shape prop to Chip

This commit is contained in:
Bernardo Cardoso
2024-04-08 15:52:54 +01:00
parent 77c67f2362
commit 557efc203e
4 changed files with 43 additions and 1 deletions

View File

@ -36,7 +36,13 @@ export class Chip implements ComponentInterface {
*/
@Prop() disabled = false;
/**
* Set to 'rectangular' for a chip with sharp corners.
*/
@Prop({ reflect: true }) shape?: 'soft' | 'round' | 'rectangular';
render() {
const { shape } = this;
const theme = getIonTheme(this);
return (
@ -44,6 +50,7 @@ export class Chip implements ComponentInterface {
aria-disabled={this.disabled ? 'true' : null}
class={createColorClasses(this.color, {
[theme]: true,
[`chip-${shape}`]: shape !== undefined,
'chip-outline': this.outline,
'chip-disabled': this.disabled,
'ion-activatable': true,