### Getting Started with AddSelect
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/src/components/add-select/add-select.mdx
A complete example demonstrating how to set up and use the AddSelect component with multiple items. Includes import and HTML structure.
```javascript
import '@carbon/ibm-products-web-components/es/components/add-select/index.js';
```
```html
```
--------------------------------
### Run Development Server with Yarn
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateTearsheet/example/README.md
Execute this command to start the local development server for the example.
```bash
yarn dev
```
--------------------------------
### Standard CreateFullPage Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateFullPage/CreateFullPage.mdx
This example demonstrates the basic implementation of the CreateFullPage pattern for a standard multi-step workflow.
```jsx
import React from 'react';
import { CreateFullPage } from '@carbon/ibm-products';
const App = () => {
return (
{/* Steps and content go here */}
);
};
export default App;
```
--------------------------------
### Install @carbon/ibm-products with npm
Source: https://github.com/carbon-design-system/ibm-products/blob/main/README.md
Use this command to install the package if you prefer npm.
```bash
npm install @carbon/ibm-products
```
--------------------------------
### Install @carbon/ibm-products-web-components
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/README.md
Install the package using yarn or npm. This is the first step to using the web components.
```shell
yarn add @carbon/ibm-products-web-components
```
```shell
npm install @carbon/ibm-products-web-components
```
--------------------------------
### Create Full Page HTML Structure
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/src/patterns/create-full-page/create-full-page.mdx
Defines the HTML structure for the Create Full Page pattern, including steps, input fields, and configuration options. This example shows a basic setup with two steps: 'Partition' and 'Configuration'.
```html
Additional configuration options...
```
--------------------------------
### Install @carbon/ibm-products
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/README.md
Install the @carbon/ibm-products package using either yarn or npm.
```shell
$ yarn add @carbon/ibm-products
```
```shell
$ npm install @carbon/ibm-products
```
--------------------------------
### Install @carbon/ibm-products with Yarn
Source: https://github.com/carbon-design-system/ibm-products/blob/main/README.md
Use this command to install the package if you prefer Yarn.
```bash
yarn add @carbon/ibm-products
```
--------------------------------
### CreateFullPage with Sections Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateFullPage/CreateFullPage.mdx
This example shows how to organize form fields into logical sections within a step of the CreateFullPage pattern.
```jsx
import React from 'react';
import { CreateFullPage, CreateFullPageStep } from '@carbon/ibm-products';
import { TextInput } from 'carbon-components-react';
const App = () => {
return (
{/* Other steps */}
);
};
export default App;
```
--------------------------------
### Install Dependencies with Yarn
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateTearsheet/example/README.md
Use this command to install project dependencies before running the development server.
```bash
yarn install
```
--------------------------------
### Configure Example in gallery.config.json
Source: https://github.com/carbon-design-system/ibm-products/blob/main/examples/carbon-for-ibm-products/APIKeyModal/README.md
Use this JSON structure to define an example's label and package configuration, including component flags, feature flags, and template variations. All fields are optional, but a label is usually specified.
```json
{
"label": "Name of example in gallery",
"package-config": {
"flags": {
"component": {
"MyComponent": true
},
"feature": {
"MyFeature": true
}
"prefix": "alt-prefix",
},
"templates-variation": "templates-react-16"
}
}
```
--------------------------------
### Stackblitz Example with Animated Media
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/components/InlineTip/InlineTip.mdx
This link directs to a Stackblitz example demonstrating the InlineTip component integrated with animated media. It's useful for seeing a practical, interactive implementation.
```html
```
--------------------------------
### Set of Actions Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/examples/set-of-actions/index.html
Example demonstrating how to set actions data for a Set of Actions component. Ensure the 'actionsData' is imported and the target element is correctly selected.
```javascript
import { actionsData } from './src/example-data.ts'; const setOfActions = document.getElementById('setOfActions'); setOfActions.actionsData = actionsData;
```
--------------------------------
### Import Guide Banner Component
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/src/components/guide-banner/guide-banner.mdx
Import the Guide Banner component into your JavaScript project.
```javascript
import '@carbon/ibm-products-web-components/es/components/guide-banner/index.js';
```
--------------------------------
### Guidebanner Collapsible Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/components/Guidebanner/Guidebanner.mdx
Demonstrates the collapsible functionality of the Guidebanner component. This example shows the default behavior where the banner can be expanded or collapsed.
```javascript
import { Story, Controls, Canvas } from '@storybook/addon-docs/blocks';
import { StackblitzLink } from '../../global/js/utils/story-helper';
import { Guidebanner } from '.';
import * as stories from './Guidebanner.stories';
```
--------------------------------
### CreateFullPage with Global Header Integration Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateFullPage/CreateFullPage.mdx
This example shows how the CreateFullPage pattern integrates with Carbon's global header and side navigation for a cohesive user experience.
```jsx
import React from 'react';
import { CreateFullPage } from '@carbon/ibm-products';
import { Header, HeaderName, SideNav, SideNavItems, SideNavLink } from 'carbon-components-react';
const App = () => {
return (
<>
Platform
Link 1
{/* Steps and content go here */}
>
);
};
export default App;
```
--------------------------------
### Install Playwright Browsers
Source: https://github.com/carbon-design-system/ibm-products/blob/main/docs/e2e_testing.md
Install the necessary browser binaries for Playwright to execute tests. This command should be run if it's the first time using Playwright in the project.
```bash
yarn playwright install
```
--------------------------------
### CreateFullPage with Header Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateFullPage/CreateFullPage.mdx
This example demonstrates how to include breadcrumbs and a page title in the header of the CreateFullPage pattern.
```jsx
import React from 'react';
import { CreateFullPage, SimpleHeader } from '@carbon/ibm-products';
import { Breadcrumb, BreadcrumbItem } from 'carbon-components-react';
const App = () => {
return (
Home} />} >
{/* Steps and content go here */}
);
};
export default App;
```
--------------------------------
### Add Select Component Usage Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/src/components/add-select/README.md
Demonstrates how to use the c4p-add-select component with multiple items and search functionality. This example shows a multi-select configuration with predefined items.
```html
```
--------------------------------
### Build and Run Storybook Locally
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/README.md
Install dependencies, build the project, and then run Storybook locally. This is useful for development and testing.
```shell
yarn
yarn build
```
```shell
yarn storybook-wc
```
--------------------------------
### Install @carbon/ibm-products-styles with npm
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-styles/README.md
Use this command to add the styles package to your project using npm.
```shell
npm install @carbon/ibm-products-styles
```
--------------------------------
### Start Storybook Locally
Source: https://github.com/carbon-design-system/ibm-products/blob/main/docs/e2e_testing.md
Start the Storybook service locally. This is a prerequisite for running Playwright tests against components in `@carbon/ibm-products`.
```bash
yarn
yarn storybook
```
--------------------------------
### CreateFullPage with Step in Error State Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/patterns/CreateFullPage/CreateFullPage.mdx
This example illustrates how to handle and display errors within a step of the CreateFullPage pattern, indicating validation issues.
```jsx
import React from 'react';
import { CreateFullPage, CreateFullPageStep } from '@carbon/ibm-products';
import { TextInput } from 'carbon-components-react';
const App = () => {
return (
{/* Other steps */}
);
};
export default App;
```
--------------------------------
### Basic Guide Banner HTML Structure
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/src/components/guide-banner/guide-banner.mdx
Render a basic Guide Banner component with a title and a collapsible body.
```html
```
--------------------------------
### Manual Saving Example
Source: https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products/src/components/Saving/Saving.mdx
Example of using the Saving component for manual saving. This is used when the user explicitly triggers the save action.
```javascript
import { Story, Controls, Source, Canvas } from '@storybook/addon-docs/blocks';
import {
CodesandboxLink,
stackblitzHref,
} from '../../global/js/utils/story-helper';
import { Saving } from '.';
import * as stories from './Saving.stories';
import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';