Web components tutorial
Welcome to Carbon! This tutorial will guide you in creating a Vanilla JS/HTML app using Web Components from the Carbon Design System. We’ll teach you the ins and outs of using Carbon components, while introducing web development best practices along the way.
Web components are native custom components based on standards that can be used in any modern browser with any JavaScript library or framework just like plain HTML elements.
For more information see Web Components.
Here’s a preview of what you will build:
Audience
This tutorial is intended for people with all amounts of web development experience. If you want to jump straight to code, you may want to skip this tutorial and go to the developers getting started page.
Prerequisites
HTML
This is a web development tutorial that uses HTML. If you’re not sure that you are quite ready then hop over to W3Schools
SCSS (CSS preprocessor)
This tutorial uses SASS, or rather the CSS styled flavour called SCSS. If you need help with CSS then head to W3Schools. For help with SCSS head to sass-lang.com.
ECMAScript (Javascript)
Javascript is fundemental to adding interaction to your HTML. There are many great resources out there, such as W3Schools, which is more than enough for everything in this tutorial.
GitHub
We’ll be using GitHub to build an app together, so if you’re new to GitHub, make sure you’ve made an account. Their getting started guide is a great way to learn GitHub.
Pnpm
This tutorial uses Pnpm for dependency management as that was the default for
create-vite
Outline
Each step in this tutorial illustrates a different aspect of developing web applications with Carbon. We recommend starting with step 1, but you can pick up any step and take it from there.
- Installing Carbon
- Create a web app with the UI shell component.
- Building pages
- Build pages with the grid and various components.
- Using APIs
- Populate the data table with an external data source.
- Creating components
- Extend Carbon by creating your own components.
- Deploying
- Build and host your app in a production environment.