Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit a47c701

Browse files
committed
Added more button examples on doc page
1 parent b997b49 commit a47c701

File tree

7 files changed

+60
-9
lines changed

7 files changed

+60
-9
lines changed

docs/components/button.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,57 @@
2020
<v-button appearance="danger">Danger</v-button>
2121
```
2222

23+
<div class="p-3 border rounded-2 my-3">
24+
<v-button loading appearance="default">Default</v-button>
25+
<v-button loading appearance="primary">Primary</v-button>
26+
<v-button loading appearance="alternative">Alternative</v-button>
27+
<v-button loading appearance="subtle">Alternative</v-button>
28+
<v-button loading appearance="success">Success</v-button>
29+
<v-button loading appearance="danger">Danger</v-button>
30+
</div>
31+
32+
``` html
33+
<v-button loading appearance="default">Default</v-button>
34+
```
35+
36+
<div class="p-3 border rounded-2 my-3">
37+
<v-button disabled appearance="default">Default</v-button>
38+
<v-button disabled appearance="primary">Primary</v-button>
39+
<v-button disabled appearance="alternative">Alternative</v-button>
40+
<v-button disabled appearance="subtle">Alternative</v-button>
41+
<v-button disabled appearance="success">Success</v-button>
42+
<v-button disabled appearance="danger">Danger</v-button>
43+
</div>
44+
45+
``` html
46+
<v-button disabled appearance="default">Default</v-button>
47+
```
48+
49+
<div class="p-3 border rounded-2 my-3">
50+
<v-button icon-first appearance="default">
51+
<svg slot="icon" viewBox="0 0 24 24" width="20" height="20"><g fill="currentColor" fill-rule="nonzero"><path d="M7.723 4.552A1 1 0 0 1 8.617 4h6.764a1 1 0 0 1 .895.554L16.997 6H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2.997l.726-1.448zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM6 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path><path d="M12 16a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path></g>
52+
</svg>
53+
Default
54+
</v-button>
55+
<v-button appearance="primary">
56+
Primary
57+
<svg slot="icon" viewBox="0 0 24 24" width="20" height="20"><g fill="currentColor" fill-rule="nonzero"><path d="M7.723 4.552A1 1 0 0 1 8.617 4h6.764a1 1 0 0 1 .895.554L16.997 6H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2.997l.726-1.448zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM6 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path><path d="M12 16a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path></g>
58+
</svg>
59+
</v-button>
60+
</div>
61+
62+
``` html
63+
<v-button disabled appearance="default">Default</v-button>
64+
```
65+
2366
## Props
2467
Name | Type | Description | Default
2568
---------- | -------- | ----------- | -----
2669
type | String | Button type, 'button' or 'submit' | button
2770
appearance | String | There are 6 options: ['default', 'primary', 'alternative', 'subtle', 'success', 'danger'] | <code>default</code>
2871
disabled | Boolean | Whether button disabled or not | false
29-
loading | Boolean | Whether button in loading state or not | false
72+
loading | Boolean | Whether button in loading state or not | false
73+
icon-first | Boolean | Set to `true` if you want to render icon before text
3074

3175
## Slots
3276
Name | Slot props | Description

docs/components/checkbox-group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Checkbox Group
1+
# Checkbox Group <badge text="stable" />
22
Set of checkbox's components
33

44
## Example

docs/components/radio-group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Radio Group
1+
# Radio Group <badge text="stable" />
22
Set of radio's components
33

44
## Example

docs/components/radio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Radio
1+
# Radio <badge text="stable" />
22
The custom radio and it's states.
33

44
## Example

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test:unit": "vue-cli-service test:unit"
1919
},
2020
"devDependencies": {
21-
"@modulist/css": "0.0.4",
21+
"@modulist/css": "0.0.5",
2222
"@vue/cli-plugin-babel": "^3.5.0",
2323
"@vue/cli-plugin-eslint": "^3.5.0",
2424
"@vue/cli-plugin-unit-jest": "^3.5.0",

src/components/Button/main.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
22
<button class="button" :class="classes" :disabled="disabled" :type="type">
3-
<slot name="icon"></slot>
43
<slot></slot>
4+
<div class="button__icon" v-if="$slots.icon">
5+
<slot name="icon"></slot>
6+
</div>
57
</button>
68
</template>
79

@@ -28,12 +30,17 @@ export default {
2830
type: Boolean,
2931
default: false,
3032
},
33+
iconFirst: {
34+
type: Boolean,
35+
default: false,
36+
},
3137
},
3238
computed: {
3339
classes() {
3440
return [
3541
`button--${this.appearance}`,
3642
{ 'button--loading': this.loading },
43+
{ 'button--icon-first': this.iconFirst },
3744
];
3845
},
3946
},

0 commit comments

Comments
 (0)