-
Notifications
You must be signed in to change notification settings - Fork 8
/
banner.vue
122 lines (98 loc) · 3.28 KB
/
banner.vue
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template lang="md">
<ComponentInfo v-bind="{ component }" />
Banners can be used as an alert at the top of the screen to display
critical messages or expandable information. It should not include a
dismiss icon, and should **only disappear** once the problem is **resolved**.
## Structure
![Banner Structure](~/assets/img/banner_alert.png)
1. **Glyph icon:** Indicates the type of this banner.
2. **Message:** Give a short description of this issue or summary of an important message.
3. **Action:** A textual call to action button to resolve this issue.
## Types
### Collapsed Banner
Only use this type of banner when this issue will cause a significant error.
<div class="element-example">
<KtBanner message="Your material is not published yet" icon="announce" actionText="Publish" />
</div>
```html
<KtBanner
message="Your material is not published yet"
icon="announce"
actionText="Publish"
/>
```
### Expand Banner
It shows the most import message inside the banner but hides other
information. Use it when you want to create a clear, non-interrupting
interface.
<div class="element-example">
<KtBanner
message="Your material is not published yet"
icon="cloud"
>
<div>
<h2>Order #100002</h2>
<h3>Order information</h3>
....
....
</div>
</KtBanner>
</div>
```html
<KtBanner message="Your material is not published yet" icon="cloud">
<div>
<h2>Order #100002</h2>
<h3>Order information</h3>
.... ....
</div>
</KtBanner>
```
## Style
### Background
You can use `banner-gray` to change the banner's background color,
this style is useful when you want add contrast to the page.
<div class="element-example white">
<KtBanner
message="Your material is not published yet"
icon="announce"
actionText="Publish"
isGray
/>
</div>
```html
<KtBanner
message="Your material is not published yet"
icon="announce"
actionText="Publish"
isGray
/>
```
## Usage
### Attributes
| Attribute | Description | Type | Accepted values | Default |
| :----------------- | :--------------------------------------------- | :-------- | :------------------ | :----------- |
| `message` | message in banner | `String` | — | — |
| `icon` | icon name from `yoco` | `String` | icon name in `yoco` | `"announce"` |
| `isGray` | gray background for high contrast | `Boolean` | — | `false` |
| `actionText` | text shows when banner is not expandable | `String` | — | — |
| `expandLabel` | text shows when expandable banner is collapsed | `String` | — | `View` |
| `expandCloseLabel` | text shows when expandable banner is expand | `String` | — | `Close` |
</template>
<script lang="ts">
import { KtBanner } from '@3yourmind/kotti-ui'
import { defineComponent } from '@vue/composition-api'
import ComponentInfo from '~/components/ComponentInfo.vue'
import ShowCase from '~/components/ShowCase.vue'
export default defineComponent({
name: 'DocumentationPageUsageComponentsBanner',
components: {
ComponentInfo,
ShowCase,
},
setup() {
return {
component: KtBanner,
}
},
})
</script>