Assuming we're starting with a new @angular/cli project:
$ npx @angular/cli new my-project --style=scss$ cd my-project$ npm i --save carbon-components-angular @carbon/styles @carbon/icons
Next, we need to include carbon styles in src/styles.scss:
@use '@carbon/styles/scss/config' with ( // Use flexbox for grid - stick to CSS Grid or Flexbox // CSS Grid has become the default grid system in v11 $use-flexbox-grid: true, // Update path of fonts to exclude tilde, required for vite (Angular 16+) $font-path: '@ibm/plex');@use '@carbon/styles';// Import css variables in roothtml { @include styles.theme(styles.$white);}
Then we need to declare @carbon/icons as a module by creating a module.d.ts file (or use any existing declaration file - has .d.ts suffix) in your src directory:
declare module '@carbon/icons/*';
That's it! Now we can run npm start and start building out our application!
Note: This isn't the only way to bootstrap a carbon-components-angular application, but the combination of @angular/cli and the @carbon/styles scss is our recommended setup.
Not supported versions: Out of support. We plan to support our latest, and previous release. Beyond that we make no guarantees of continued support - these include v1, v2
How to read this table:
Community support: We depend primarily on community issue reports, and contributions to help maintain our components. A version with only community support is especially reliant on contributions, though we will backport small fixes when applicable.
Active support: We will actively maintain and update these versions with new features, new components, bug fixes, and ensure it's compatible with the Carbon Design System and latest Angular versions
If you are an IBMer, you must complete the steps at W3 Developer before contributing to any open source projects. See our contributing guidelines for more details.
If you create a pull request and then realize it is not ready to be merged, prepend "WIP: " (For example, WIP: Fixed text overflow in accordion headers.) and assign a WIP label.
Include a description of changes
attach a screenshot (or a gif!) for design reference if needed
reference the related issue
"closes #123" or "fixes #123" will close issue #123 once the PR is merged
"issue #123" just references the issue. Only use this if you definitely need the issue to remain open.
@mention any specific other developers that need to be aware of the changes
add the "needs review" label along with any other relevant labels
To keep our build dependencies local we use npm scripts to run our webpack, gulp, and general build tasks. You should never install webpack or gulp globally as that will likely conflict with our version. You should never need to modify the build process to add a component or story.
npm run storybook to run storybook (port 6006)
npm run build to generate the dist
docs:build to build documentation
docs:server to build and run the documentation server
Components should be the smallest unit of computation
Think in terms of pages and applications composed from a multitude of components rather than pages or applications as a single unit of computation
Components should delegate to the consumer whenever possible
The individual applications should be the single source of truth, and be able to create any UI from our building blocks
Components should do one thing, and do it well
This does not mean they should be over specialized, but rather focus on providing a single, core experience
Components should NOT maintain more state than absolutely necessary
Likewise, stateless components should be favored whenever possible
Components should NOT necessarily implement the style guide point-for-point, the guide simply provides guidance on overarching functionality, components should enable that and product specific designs without baking in extra functionality
This package uses IBM Telemetry to collect de-identified and anonymized metrics data. By installing
this package as a dependency you are agreeing to telemetry collection. To opt out, see
Opting out of IBM Telemetry data collection.
For more information on the data being collected, please see the
IBM Telemetry documentation.