Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit b43c11e

Browse files
committed
docs(badge): add button docs
1 parent fbd2bad commit b43c11e

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

docs/.vitepress/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function getSetupSidebar() {
4545
text: 'Components',
4646
children: [
4747
{ text: 'Alert', link: '/components/alert' },
48+
{ text: 'Badge', link: '/components/badge' },
4849
{ text: 'Button', link: '/components/button' },
4950
{ text: 'Icon', link: '/components/icon' },
5051
{ text: 'Spinner', link: '/components/spinner' },
@@ -62,6 +63,7 @@ function getComponentsSidebar() {
6263
children: [
6364
{ text: 'Alert', link: '/components/alert' },
6465
{ text: 'Button', link: '/components/button' },
66+
{ text: 'Badge', link: '/components/badge' },
6567
{ text: 'Icon', link: '/components/icon' },
6668
{ text: 'Spinner', link: '/components/spinner' },
6769
{ text: 'CSS reset', link: '/components/css-reset' },

docs/components/badge.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Badge
2+
3+
Badges are used to highlight an item's status for quick recognition.
4+
5+
## Import
6+
7+
```bash
8+
import { CBadge } from "@chakra-ui/vue-next"
9+
```
10+
11+
## Usage
12+
```vue
13+
<c-badge color-scheme="blue">Badge</c-badge>
14+
```
15+
16+
### Badge Color
17+
18+
Pass the `colorScheme` prop to customize the color of the Badge. `colorScheme`
19+
can be any **color key** that exists in `theme.colors`.
20+
21+
TODO: Link to theming page
22+
23+
```vue
24+
<c-badge>Default</c-badge>
25+
<c-badge color-scheme="green">Success</c-badge>
26+
<c-badge color-scheme="red">Removed</c-badge>
27+
<c-badge color-scheme="purple">New</c-badge>
28+
```
29+
30+
### Badge Variants
31+
32+
Pass the `variant` prop and set it to either `subtle`, `solid`, or `outline` to
33+
get a different style.
34+
35+
```vue
36+
<c-badge variant="outline" color-scheme="green">Default</c-badge>
37+
<c-badge variant="solid" color-scheme="green">Success</c-badge>
38+
<c-badge variant="subtle" color-scheme="green">Removed</c-badge>
39+
```
40+
41+
TODO: Add composition examples
42+
43+
## Props
44+
45+
The `CBadge` component composes `CBox` component so you can pass props for `CBox`.
46+
| Name | Type | Description | Default |
47+
| :---: | :---: | :---: | :---: |
48+
|`colorScheme`|`"blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "whiteAlpha" | "blackAlpha" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"`| Theme color scheme |`"gray"`|
49+
|`size` | `"sm" | "md" | "lg" | "xs"` | Sizes for Badge are not implemented in the default theme. You can extend the theme to implement them. | - |
50+
|`variant` | `"outline" | "solid" | "subtle"` | | `"subtle"` |

0 commit comments

Comments
 (0)