-
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: center component documentation * refactor: change name casing center * refactor: change name casing center
- Loading branch information
Showing
5 changed files
with
106 additions
and
4 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,13 @@ | ||
<template> | ||
<CHStack> | ||
<CCenter w='40px' h='40px' bg='tomato' color='white'> | ||
<CIcon name="phone" /> | ||
</CCenter> | ||
<CCenter w='40px' h='40px' bg='tomato' color='white'> | ||
<CBox as='span' fontWeight='bold' fontSize='lg'> | ||
1 | ||
</CBox> | ||
</CCenter> | ||
</CHStack> | ||
</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,5 @@ | ||
<template> | ||
<CCenter bg='tomato' h='100px' color='white'> | ||
This is the Center | ||
</CCenter> | ||
</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,10 @@ | ||
<template> | ||
<CHStack> | ||
<CCircle size='40px' bg='teal.800' color='white'> | ||
<CIcon name="phone" /> | ||
</CCircle> | ||
<CSquare size='40px' bg='rebeccapurple' color='white'> | ||
<CIcon name="phone" /> | ||
</CSquare> | ||
</CHStack> | ||
</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,76 @@ | ||
--- | ||
title: Center | ||
description: Center Component | ||
version: 2.0+ | ||
--- | ||
|
||
# Center | ||
|
||
Center is a layout component that centers its child within itself. | ||
|
||
## Import | ||
|
||
```js | ||
import { CCenter, CCircle, CSquare } from '@chakra-ui/vue-next'; | ||
``` | ||
|
||
- CCenter: centers its child given `width` and `height` | ||
- CSquare: centers its child given `size` (width and height) | ||
- CCircle: a Square with round `border-radius` | ||
|
||
## Usage | ||
|
||
Put any child element inside it, give it any `width` or/and `height`, it'll ensure the child is centered. | ||
|
||
::showcase | ||
::simple-center{width=full} | ||
:: | ||
:: | ||
|
||
```html | ||
<CCenter bg='tomato' h='100px' color='white'> | ||
This is the Center | ||
</CCenter> | ||
``` | ||
|
||
## With Icons | ||
|
||
CCenter can be used to create frames around icons or numbers. | ||
|
||
::showcase | ||
::icon-center | ||
:: | ||
:: | ||
|
||
```html | ||
<CHStack> | ||
<CCenter w='40px' h='40px' bg='tomato' color='white'> | ||
<CIcon name="phone" /> | ||
</CCenter> | ||
<CCenter w='40px' h='40px' bg='tomato' color='white'> | ||
<CBox as='span' fontWeight='bold' fontSize='lg'> | ||
1 | ||
</CBox> | ||
</CCenter> | ||
</CHStack> | ||
``` | ||
|
||
## Square and Circle | ||
|
||
The Square and Circle components automatically centers its children given the size. | ||
|
||
::showcase | ||
::square-and-circle | ||
:: | ||
:: | ||
|
||
```html | ||
<CHStack> | ||
<CCircle size='40px' bg='teal.800' color='white'> | ||
<CIcon name="phone" /> | ||
</CCircle> | ||
<CSquare size='40px' bg='rebeccapurple' color='white'> | ||
<CIcon name="phone" /> | ||
</CSquare> | ||
</CHStack> | ||
``` |
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
75ccf7b
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-git-main-chakra-ui.vercel.app
next.vue.chakra-ui.com
vue-docs-next-chakra-ui.vercel.app
vue-docs-next.vercel.app