Skip to content

Commit f453dac

Browse files
authored
docs(web-components): update wc readme (#18716)
1 parent a0d1fe9 commit f453dac

File tree

2 files changed

+8
-49
lines changed

2 files changed

+8
-49
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
310310
<td align="center"><a href="https://github.com/Neues"><img src="https://avatars.githubusercontent.com/u/9409245?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Noah Sgorbati</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=Neues" title="Code">💻</a> <a href="https://github.com/carbon-design-system/carbon/commits?author=Neues" title="Documentation">📖</a></td>
311311
<td align="center"><a href="https://github.com/divya-281"><img src="https://avatars.githubusercontent.com/u/72991264?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Divya G</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=divya-281" title="Code">💻</a></td>
312312
<td align="center"><a href="https://github.com/soumyaraju"><img src="https://avatars.githubusercontent.com/u/41182657?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Soumya Raju</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=soumyaraju" title="Code">💻</a></td>
313-
<td align="center"><a href="https://irfadkp.github.io/"><img src="https://avatars.githubusercontent.com/u/54243898?v=4?s=100" width="100px;" alt=""/><br /><sub><b>IRFAD KP</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=irfadkp" title="Code">💻</a></td>
314313
<td align="center"><a href="https://github.com/mikdhadc"><img src="https://avatars.githubusercontent.com/u/54241506?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mohammed Mikdhad C</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=mikdhadc" title="Code">💻</a></td>
315314
</tr>
316315
<tr>

packages/web-components/README.md

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To install `@carbon/web-components` in your project, you will need to run the
88
following 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

1414
If 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
3229
import '@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

12687
If 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).
146107
For 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

Comments
 (0)