Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 2.15 KB

File metadata and controls

37 lines (23 loc) · 2.15 KB

Example app with carbon-components-react

This example features how you use IBM's carbon-components-react (Carbon Design System) with Next.js.

Create your own theme with Carbon Design System's theming tools and put it all together as demonstrated in static/myCustomTheme.scss

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example with-carbon-components with-carbon-components-app
yarn create next-app --example with-carbon-components with-carbon-components-app
pnpm create next-app --example with-carbon-components with-carbon-components-app

Deploy it to the cloud with Vercel (Documentation).

Optimizations

In this example we import carbon components in the styles/custom-theme.scss file like this: @import '~carbon-components/scss/globals/scss/styles.scss';

When we start to consider the performance of this approach, however, it becomes clear that this will include every single bit of CSS that Carbon outputs. Sometimes, you totally need everything that the project provides, but for a good number of teams you may find yourself using only a subset of our components. Here is a great article about how you can optimize your application using carbon components: https://medium.com/carbondesign/minimal-css-with-carbon-b0c089ccfa71