-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathdivider.tsx
More file actions
50 lines (46 loc) · 1.24 KB
/
divider.tsx
File metadata and controls
50 lines (46 loc) · 1.24 KB
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
43
44
45
46
47
48
49
50
import { getIonTheme } from '@global/ionic-global';
import type { ComponentInterface } from '@stencil/core';
import { Component, Prop, Host, h } from '@stencil/core';
@Component({
tag: 'ion-divider',
styleUrls: {
ios: 'divider.ios.scss',
md: 'divider.md.scss',
ionic: 'divider.ionic.scss',
},
shadow: true,
})
export class Divider implements ComponentInterface {
/**
* Set to `"xxsmall"` for the smallest spacing.
* Set to "xsmall" for very small spacing.
* Set to `"small"` for small spacing.
* Set to "medium" for medium spacing.
* Set to "large" for large spacing.
* Set to `"xlarge"` for the largest spacing.
*
* Defaults to `"medium"`.
*/
@Prop({ reflect: true }) spacing?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' =
'medium';
/**
* If `true`, the divider will have horizontal margins
* By default, it's `false`
*/
@Prop() inset: boolean = false;
render() {
const { inset, spacing } = this;
const theme = getIonTheme(this);
return (
<Host
class={{
[theme]: true,
[`divider-spacing-${spacing}`]: spacing !== undefined,
[`divider-inset`]: inset,
}}
>
<hr />
</Host>
);
}
}