@chakra-ui/vue

中文文档
0.13.1发布于 2023/03/25MITTypeScriptESM + CJS近 30 天下载 1694

Build Accessible and Responsive Vue.js websites and applications with speed ⚡️

原始使用文档
文档目录9 节
  1. Build scalable and accessible Vue.js applications with ease.
  2. Looking for the documentation?
  3. Features
  4. Table of Contents
  5. Installation
  6. Usage
  7. Codesandbox starters
  8. Storybook Components
  9. Development for Contributing:

Build & Test Components Netlify Status All contributors

chakra-ui symbol

Build scalable and accessible Vue.js applications with ease.

@chakra-ui/vue gives you a set of accessible and composable Vue components that you can use to build your favourite applications and sites.

Made for Vue 2.X

Looking for the documentation?

Head over here => https://vue.chakra-ui.com

中文文档翻译Github问题

Features

  • Ease of Styling: Chakra UI contains a set of layout components like CBox, CFlex and CStack that make it easy to style your components by passing props. Learn more
  • Flexible & composable: Chakra UI components are built on top of a Vue UI Primitive for endless composability.
  • Accessible. Chakra UI components follows the WAI-ARIA guidelines specifications and have the right aria-* attributes.
  • Dark Mode 😍: Most components in Chakra UI are dark mode compatible.

Table of Contents

  1. Installation
  2. Usage a. With Nuxt

Installation

yarn add @chakra-ui/vue emotion

or

npm install @chakra-ui/vue emotion

Note: If you're using Nuxt, you need to install @nuxtjs/emotion package as well to server-side render your styles.

yarn add @chakra-ui/vue emotion @nuxtjs/emotion

Usage

1. Import the Chakra UI plugin in your main.js file.

import Vue from 'vue'
import Chakra from '@chakra-ui/vue'
import App from './App.vue'

Vue.use(Chakra)

new Vue({
  el: '#app',
  render: (h) => h(App)
}).$mount()

2. Wrap your application inside the Chakra CThemeProvider. We also recommend that you include the CReset component to normalize all browser styling.

In your App.vue file.

<template>
  <CThemeProvider>
    <CReset />

    <!--
      Your application code goes here! 😁
    -->
  </CThemeProvider>
</template>

<script>
  import { CThemeProvider, CReset } from '@chakra-ui/vue'

  export default {
    name: 'App',
    components: {
      CThemeProvider,
      CReset
    }
  }
</script>

If you'd like to toggle your app between dark and light mode, you can also wrap your application inside the ColorModeProvider component.

3. Hurray!🎉 Now the fun can begin. You can start using components like so:

<template>
  <CThemeProvider>
    <CReset />

    <!--
      Your application code goes here! 😁
    -->
    <CButton variantColor="blue">
      Chakra consumed ⚡️
    </CButton>
  </CThemeProvider>
</template>

<script>
  import { CThemeProvider, CReset, CButton } from '@chakra-ui/vue'

  export default {
    name: 'App',
    components: {
      CThemeProvider,
      CReset,
      CButton
    }
  }
</script>

Codesandbox starters

Storybook Components

You can also view all developed components in Storybook!

Development for Contributing:

Interested in contributing? See our open issues! Remember to take a look at our CONTRIBUTORS guide.

yarn install
yarn bootstrap
yarn dev

Created by Jonathan Bakebwa

版本与发布记录

@chakra-ui/vue 共发布 65 个版本,首次发布于 2020/03/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.13.1latest2023/03/253 年前
0.13.02023/01/233 年前
0.12.02022/06/144 年前
0.11.02022/01/204 年前
0.10.22021/08/265 年前
0.10.2-next.0next2021/08/265 年前

关于 @chakra-ui/vue 的常见问题

@chakra-ui/vue 是什么?

Build Accessible and Responsive Vue.js websites and applications with speed ⚡️

如何安装 @chakra-ui/vue?

在项目目录运行 npm install @chakra-ui/vue,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(>=2.6.10)、@emotion/css(^11.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@chakra-ui/vue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chakra-ui/vue 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@chakra-ui/vue 可以商用吗?

@chakra-ui/vue 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chakra-ui/vue 的下载量有多少?

根据 npm 官方下载统计,@chakra-ui/vue 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,694 次,日均约 56 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chakra-ui/vue 还在维护吗?

最新版本 0.13.1 发布于 2023/03/25(3 年前);至今共发布 65 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/03/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。