MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / Button

Class Button

core/src/components/button/button.tsx:31–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 shadow: true,
30})
31export class Button implements ComponentInterface, AnchorInterface, ButtonInterface {
32 private inItem = false;
33 private inListHeader = false;
34 private inToolbar = false;
35 private formButtonEl: HTMLButtonElement | null = null;
36 private formEl: HTMLFormElement | null = null;
37 private inheritedAttributes: Attributes = {};
38
39 @Element() el!: HTMLElement;
40
41 /**
42 * If `true`, the button only has an icon.
43 */
44 @State() isCircle: boolean = false;
45
46 /**
47 * The color to use from your application's color palette.
48 * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
49 * For more information on colors, see [theming](/docs/theming/basics).
50 */
51 @Prop({ reflect: true }) color?: Color;
52
53 /**
54 * The type of button.
55 */
56 @Prop({ mutable: true }) buttonType = 'button';
57
58 /**
59 * If `true`, the user cannot interact with the button.
60 */
61 @Prop({ reflect: true }) disabled = false;
62 @Watch('disabled')
63 disabledChanged() {
64 const { disabled } = this;
65 if (this.formButtonEl) {
66 this.formButtonEl.disabled = disabled;
67 }
68 }
69
70 /**
71 * Set to `"block"` for a full-width button or to `"full"` for a full-width button
72 * with square corners and no left or right borders.
73 */
74 @Prop({ reflect: true }) expand?: 'full' | 'block';
75
76 /**
77 * Set to `"clear"` for a transparent button that resembles a flat button, to `"outline"`
78 * for a transparent button with a border, or to `"solid"` for a button with a filled background.
79 * The default fill is `"solid"` except inside of a toolbar, where the default is `"clear"`.
80 */
81 @Prop({ reflect: true, mutable: true }) fill?: 'clear' | 'outline' | 'solid' | 'default';
82
83 /**
84 * When using a router, it specifies the transition direction when navigating to
85 * another page using `href`.
86 */
87 @Prop() routerDirection: RouterDirection = 'forward';
88

Callers

nothing calls this directly

Calls 3

submitFormMethod · 0.95
openURLFunction · 0.90
hasShadowDomFunction · 0.90

Tested by

no test coverage detected