### Install Dependencies and Generate Types
Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md
Run the setup script to install root and docs dependencies and generate TypeScript definitions and API JSON.
```sh
bun setup
```
--------------------------------
### Install carbon-preprocess-svelte
Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/content/overview.md
Install carbon-preprocess-svelte as a development dependency for optimizing imports and CSS.
```bash
npm i -D carbon-preprocess-svelte
# pnpm
pnpm i -D carbon-preprocess-svelte
# Yarn
yarn add -D carbon-preprocess-svelte
# Bun
bun add -D carbon-preprocess-svelte
```
--------------------------------
### Install Carbon Preprocess Svelte
Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/README.md
Install the optional carbon-preprocess-svelte as a development dependency.
```sh
# npm
npm i -D carbon-preprocess-svelte
# pnpm
pnpm i -D carbon-preprocess-svelte
```
--------------------------------
### Install Carbon Components Svelte
Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/content/overview.md
Install the Carbon Components Svelte library using your preferred package manager.
```sh
# npm
npm i carbon-components-svelte
# pnpm
pnpm i carbon-components-svelte
# Yarn
yarn add carbon-components-svelte
# Bun
bun add carbon-components-svelte
```
--------------------------------
### Multiple Dropdowns Example
Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Dropdown.svx
Illustrates how to implement and manage multiple dropdowns that interact with each other.
```svelte
This is floating content.
Refresh the page to see the persisted state.
Close the tab to clear the state.
``` -------------------------------- ### Default Accordion Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Accordion.svx Demonstrates the basic usage of Accordion and AccordionItem components with default right-aligned chevrons. ```svelteNatural Language Classifier uses advanced natural language processing and machine learning techniques to create custom classification models. Users train their data and the service predicts the appropriate category for the inputted text.
Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.
Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.
This is the modal body content.
Content for step 1.
{:else if currentStep === 1}Content for step 2.
{:else}Content for step 3.
{/if}This is a tooltip.
Rendered direction: {direction}
{JSON.stringify(row, null, 2)}
Value: {value}
``` -------------------------------- ### Tooltip Alignment Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Tooltip.svx Align the tooltip content using the `align` prop. Options include 'start', 'end', and 'center'. ```svelteStart
End
Center
Content for the first modal.
Content for the second modal.
Natural Language Classifier uses advanced natural language processing and machine learning techniques to create custom classification models. Users train their data and the service predicts the appropriate category for the inputted text.
Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.
Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.
This is floating content.
Current breakpoint: {currentSize}
``` -------------------------------- ### Toolbar Menu with Primary Focus Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Toolbar.svx Set `primaryFocus` on a `ToolbarMenuItem` to ensure it receives focus when the menu is opened, guiding user interaction. ```svelteCurrent user: {user}, Theme: {theme}
``` -------------------------------- ### Basic Portal Usage Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Portal.svx Renders content directly into the document body. Useful for modals, tooltips, and menus that need to escape parent containers. ```svelte