Frameworks
The library provides front-end developers & engineers a collection of reusable Vue components to build websites and user interfaces. Adopting the library enables developers to use consistent markup, styles, and behavior in prototype and production work.
Resources
Getting started
Assuming we’re starting with a new Vue CLI project:
npm create vue@latestcd vue-project
npm install @carbon/vue
In src/main.js, after
import App from './App.vue'
import 'carbon-components/css/carbon-components.css';import CarbonComponentsVue from '@carbon/vue';const app = createApp(App);app.use(CarbonComponentsVue);app.mount('#app');// remove the line: createApp(App).mount('#app')
Replace the contents of src/components/HelloWorld.vue with the following
<script setup>import { ref } from 'vue';const yourName = ref('');const visible = ref(false);function onClick() {visible.value = true;}function modalClosed() {
That’s it! Now start the server and start building.
npm run dev
Note: This isn’t the only way to bootstrap a
carbon-components-vue
Vue CLI
carbon-components
List of available components
View available Vue Components here. Usage information is available in the notes provided with each story.
Troubleshooting
If you experience any issues while getting set up with Carbon Components Vue, please head over to the GitHub repo for more guidelines and support. Please create an issue if your issue does not already exist.