-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: code component documentation * refactor: change name casing code * refactor: change name casing code
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<CStack is-inline> | ||
<CCode>console.log(welcome)</CCode> | ||
<CCode color-scheme="red">var chakra = 'awesome!'</CCode> | ||
<CCode color-scheme="yellow">npm install chakra</CCode> | ||
</CStack> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<CCode> Hello world </CCode> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<CStack is-inline> | ||
<CCode color-scheme="whatsapp" variant="outline">Outline </CCode> | ||
<CCode color-scheme="whatsapp" variant="subtle">Solid </CCode> | ||
<CCode color-scheme="whatsapp" variant="solid">Solid</CCode> | ||
</CStack> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: Code | ||
description: Code component | ||
version: 2.0+ | ||
--- | ||
# Code | ||
|
||
Code is a component used to display inline code. It is composed of the `Box` component with a font family of `mono` for displaying code. | ||
|
||
## Import | ||
|
||
```js | ||
import { CCode } from "@chakra-ui/vue-next" | ||
``` | ||
|
||
## Usage | ||
|
||
::showcase | ||
:simple-code | ||
:: | ||
|
||
```html | ||
<CCode>Hello world </CCode> | ||
``` | ||
|
||
## Colors | ||
|
||
You can change the color scheme of the component by passing the `colorScheme` prop. | ||
|
||
::showcase | ||
:colors-code | ||
:: | ||
|
||
```html | ||
<CStack is-inline> | ||
<CCode>console.log(welcome)</CCode> | ||
<CCode color-scheme="red">var chakra = 'awesome!'></CCode> | ||
<CCode color-scheme="yellow">npm install chakra</CCode> | ||
</CStack> | ||
``` | ||
|
||
## Variant | ||
|
||
You can change the variant of the component by passing the `variant` prop. | ||
|
||
::showcase | ||
:variant-code | ||
:: | ||
|
||
```html | ||
<CStack is-inline> | ||
<CCode color-scheme="whatsapp" variant="outline">Outline </CCode> | ||
<CCode color-scheme="whatsapp" variant="subtle">Solid </CCode> | ||
<CCode color-scheme="whatsapp" variant="solid">Solid</CCode> | ||
</CStack> | ||
``` | ||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
|---------------|------------------------------------|----------|---------------------------------------| | ||
| `colorScheme` | `string` | `grey` | The color scheme to use for the code. | | ||
| `variant` | `"solid" \| "subtle" \| "outline"` | `subtle` | The variant of the Code | | ||
|
||
## Slots | ||
|
||
| Name | Description | | ||
|---------------|---------------------------------------| | ||
| `default` | Used for the `CCode` content. | |
44c3ac2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vue-docs-next – ./
vue-docs-next-chakra-ui.vercel.app
vue-docs-next-git-main-chakra-ui.vercel.app
next.vue.chakra-ui.com
vue-docs-next.vercel.app