-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
buttons.tsx
42 lines (39 loc) · 1.08 KB
/
buttons.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { ComponentInterface } from '@stencil/core';
import { Component, Host, Prop, h } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
@Component({
tag: 'ion-buttons',
styleUrls: {
ios: 'buttons.ios.scss',
md: 'buttons.md.scss',
},
scoped: true,
})
export class Buttons implements ComponentInterface {
/**
* If true, buttons will disappear when its
* parent toolbar has fully collapsed if the toolbar
* is not the first toolbar. If the toolbar is the
* first toolbar, the buttons will be hidden and will
* only be shown once all toolbars have fully collapsed.
*
* Only applies in `ios` mode with `collapse` set to
* `true` on `ion-header`.
*
* Typically used for [Collapsible Large Titles](https://ionicframework.com/docs/api/title#collapsible-large-titles)
*/
@Prop() collapse = false;
render() {
const mode = getIonMode(this);
return (
<Host
class={{
[mode]: true,
['buttons-collapse']: this.collapse,
}}
>
<slot></slot>
</Host>
);
}
}