About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
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'
, add the following to
include the carbon styles and components.
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
application, but the combination of Vue CLI
and the carbon-components
scss is our recommended setup. See
Hello carbon vue3 for a complete
example app.
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.