mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
34 lines
881 B
TypeScript
34 lines
881 B
TypeScript
import { Component, ComponentInterface, Prop } from '@stencil/core';
|
|
|
|
import { Color, Mode } from '../../interface';
|
|
import { createColorClasses } from '../../utils/theme';
|
|
|
|
@Component({
|
|
tag: 'ion-chip',
|
|
styleUrls: {
|
|
ios: 'chip.ios.scss',
|
|
md: 'chip.md.scss'
|
|
},
|
|
scoped: true
|
|
})
|
|
export class Chip 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.
|
|
* Possible values are: `"ios"` or `"md"`.
|
|
*/
|
|
@Prop() mode!: Mode;
|
|
|
|
hostData() {
|
|
return {
|
|
class: createColorClasses(this.color),
|
|
};
|
|
}
|
|
}
|