mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
* docs(all): possible values are extracted by stencil * add defaults * remove all hardcoded defaults * update stencil
37 lines
883 B
TypeScript
37 lines
883 B
TypeScript
import { Component, ComponentInterface, Prop } from '@stencil/core';
|
|
|
|
import { Color, Mode } from '../../interface';
|
|
import { createColorClasses } from '../../utils/theme';
|
|
|
|
@Component({
|
|
tag: 'ion-badge',
|
|
styleUrls: {
|
|
ios: 'badge.ios.scss',
|
|
md: 'badge.md.scss'
|
|
},
|
|
shadow: true
|
|
})
|
|
export class Badge implements ComponentInterface {
|
|
/**
|
|
* The color to use from your application's color palette.
|
|
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
|
|
* For more information on colors, see [theming](/docs/theming/basics).
|
|
*/
|
|
@Prop() color?: Color;
|
|
|
|
/**
|
|
* The mode determines which platform styles to use.
|
|
*/
|
|
@Prop() mode!: Mode;
|
|
|
|
hostData() {
|
|
return {
|
|
class: createColorClasses(this.color)
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return <slot></slot>;
|
|
}
|
|
}
|