diff --git a/components/content/examples/badge/BaseBadge.vue b/components/content/examples/badge/BaseBadge.vue new file mode 100644 index 0000000..1c7b521 --- /dev/null +++ b/components/content/examples/badge/BaseBadge.vue @@ -0,0 +1,3 @@ + diff --git a/components/content/examples/badge/ColorBadge.vue b/components/content/examples/badge/ColorBadge.vue new file mode 100644 index 0000000..2b141b7 --- /dev/null +++ b/components/content/examples/badge/ColorBadge.vue @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/components/content/examples/badge/CompositionBadge.vue b/components/content/examples/badge/CompositionBadge.vue new file mode 100644 index 0000000..172bf27 --- /dev/null +++ b/components/content/examples/badge/CompositionBadge.vue @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/components/content/examples/badge/CompositionBadgeTwo.vue b/components/content/examples/badge/CompositionBadgeTwo.vue new file mode 100644 index 0000000..7fa6809 --- /dev/null +++ b/components/content/examples/badge/CompositionBadgeTwo.vue @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/components/content/examples/badge/VariantBadge.vue b/components/content/examples/badge/VariantBadge.vue new file mode 100644 index 0000000..ac9faf1 --- /dev/null +++ b/components/content/examples/badge/VariantBadge.vue @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/content/4.components/badge.md b/content/4.components/badge.md new file mode 100644 index 0000000..5c5a961 --- /dev/null +++ b/content/4.components/badge.md @@ -0,0 +1,118 @@ +--- +title: Badge +description: Badge Component +version: 2.0+ +--- + +# Badge + +The `CBadge` component is used to highlight an item's status for quick recognition. + +## Import + +```js +import { CBadge } from '@chakra-ui/vue-next'; +``` + +## Usage + +::showcase +::base-badge +:: +:: + +```html +Default +``` + +### Badge Color + +Pass the `color-scheme` prop to customize the color of the `CBadge`. `variant-color` can be any color key that exists in the `$chakra.theme.colors`. Here `$chakra.theme` is your theme object. + + +::showcase +::wrap{align="center"} +::color-badge +:: + +```html + + Default + Success + Removed + New + +``` + +### Badge Variants + +Pass the `variant` prop and set it to either `subtle`, `solid`, or `outline` to get a different style. + +::showcase +::variant-badge +:: +:: + +```html + + Subtle + Solid + Outline + +``` + +## Compositon + + +::showcase +::composition-badge +:: +:: + +```html + + + + + Jonathan Bakebwa + + New + + + UI Engineer + + +``` + +You can also change the size of the badge by passing `font-size` prop. + +::showcase +::composition-badge-two +:: +:: + +```html + + Jonathan Bakebwa + + New + + +``` + +## Props + +> The `CBadge` component composes `CBox` component so you can pass props for `Box`. + +| Name | Type | Default | Description | +|-----------------|------------------------------|----------|--------------------------------------------------------------------------------| +| `variant` | `solid`, `subtle`, `outline` | `subtle` | The style variant of the badge | +| `variant-color` | `string` | `gray` | The color scheme to use for the badge. Must be a key in `$chakra.theme.colors` | + + +## Slots + +| Name | Description | +|---------|----------------------------| +| default | Text rendered inside badge | +