@@ -8,7 +8,7 @@ To install `@carbon/web-components` in your project, you will need to run the
88following command using [ npm] ( https://www.npmjs.com/ ) :
99
1010``` bash
11- npm install --save @carbon/web-components
11+ npm install -S @carbon/web-components
1212```
1313
1414If you prefer [ Yarn] ( https://yarnpkg.com/en/ ) , use the following command
@@ -20,13 +20,10 @@ yarn add @carbon/web-components
2020
2121### Usage
2222
23- #### ES imports
23+ The ` @carbon/web-components ` package provides components for the Carbon Design
24+ System.
2425
25- The first thing you need is ** setting up a module bundler** to resolve
26- ECMAScript ` import ` s. The above example uses [ Webpack] ( https://webpack.js.org ) ,
27- but you can use other bundlers like [ Rollup] ( https://rollupjs.org/ ) too.
28-
29- Once you set up a module bundler, you can start importing component modules:
26+ To use a component, you can import it directly from the package:
3027
3128``` javascript
3229import ' @carbon/web-components/es/components/dropdown/dropdown.js' ;
@@ -46,23 +43,20 @@ same manner as native HTML tags:
4643</cds-dropdown >
4744```
4845
49- See a working example
50- [ here] ( https://stackblitz.com/github/carbon-design-system/carbon/tree/main/packages/web-components/examples/components/dropdown ) .
51-
5246#### CDN
5347
54- The CDN artifacts define the custom elements for the browser, so they can be
55- directly used once the script tag has been added to the page. For example :
48+ CDN artifacts are also available and can be added directly to the page (starting
49+ at version ` v1.16.0 ` ) :
5650
5751``` html
5852<!doctype html>
5953<html >
6054 <head >
6155 <script
6256 type =" module"
63- src =" https://1.www.s81c.com/common/carbon/web-components/tag /v2/latest /dropdown.min.js" ></script >
57+ src =" https://1.www.s81c.com/common/carbon/web-components/version /v2.24.0 /dropdown.min.js" ></script >
6458 <style type =" text/css" >
65- // Suppresses the custom element until it has been defined
59+ <!-- hide custom element until it has been defined //-- >
6660 cds-dropdown :not (:defined),
6761 cds-dropdown-item :not (:defined) {
6862 visibility : hidden ;
@@ -83,44 +77,11 @@ directly used once the script tag has been added to the page. For example:
8377</html >
8478```
8579
86- Each component is available by referencing a specific version (starting at
87- version ` v1.16.0 ` ):
88-
89- <!-- By specific version -->
90- <script
91- type="module"
92- src="https://1.www.s81c.com/common/carbon/web-components/version/v2.16.0/accordion.min.js"></script >
93-
94- ```
95-
96- See a working example
97- [here](https://stackblitz.com/github/carbon-design-system/carbon/tree/main/packages/web-components/examples/components/dropdown?file=cdn.html).
98-
99- For a full list of components available, check out our
100- [Storybook](https://web-components.carbondesignsystem.com/).
101-
10280### Other usage guides
10381
10482- [ Using components in a form] ( ./docs/form.md )
10583- [ Using custom styles in components] ( ./docs/styling.md )
10684
107- ## Getting started with development
108-
109- 1. Fork this repository and clone it
110- 2. `yarn install`
111- 3. `cd packages/carbon-web-components`
112- 4. `yarn wca && yarn storybook`
113-
114- ## Creating build
115-
116- ```
117-
118- > yarn install yarn build
119-
120- ```
121-
122- You'll see the build artifacts in `/path/to/carbon-web-components/es` directory.
123-
12485## 📖 API Documentation
12586
12687If you're looking for ` @carbon/web-components ` API documentation, check out:
@@ -145,4 +106,3 @@ collection. To opt out, see
145106[ Opting out of IBM Telemetry data collection] ( https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection ) .
146107For more information on the data being collected, please see the
147108[ IBM Telemetry documentation] ( https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics ) .
148- ```
0 commit comments