### 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 ``` -------------------------------- ### Install carbon-preprocess-svelte with Bun Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/README.md Use this command to add the package as a development dependency using Bun. ```bash bun add -D carbon-preprocess-svelte ``` -------------------------------- ### Complete Toolbar Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Toolbar.svx Combine `ToolbarSearch`, `ToolbarMenu`, and `Button` components for a comprehensive toolbar with search, actions, and an overflow menu. ```svelte Restart all API documentation Stop all ``` -------------------------------- ### Run Docs Development Server Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Navigate to the docs directory and start the local development server to preview the documentation site. ```sh cd docs bun dev ``` -------------------------------- ### Button Component Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Example of using the Button component with a secondary kind. ```svelte ``` -------------------------------- ### Number Input with Step Start Value Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/NumberInput.svx Configures a starting point for stepping when the input is empty or zero using `stepStartValue`. This is useful when zero is not a sensible default or outside the min/max range. ```svelte ``` -------------------------------- ### Custom Styles Patching Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Illustrates how to apply custom SCSS patches for themeable styles. ```scss // css/patches.scss // Example: Patching a Carbon v10 style .bx--btn--primary { // Custom styles here border-radius: 0.25rem; } ``` -------------------------------- ### Reactive ComboBox Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ComboBox.svx Demonstrates how the combobox component reacts to user input and selection changes. ```svelte ``` -------------------------------- ### Install carbon-preprocess-svelte with Yarn Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/README.md Use this command to add the package as a development dependency using Yarn. ```bash yarn add -D carbon-preprocess-svelte ``` -------------------------------- ### Basic FloatingPortal Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FloatingPortal.svx Renders floating content below an anchor element. Click the button to toggle visibility. ```svelte

This is floating content.

``` -------------------------------- ### Conventional Commit Subject Examples Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Provides examples of concise and descriptive subject lines for conventional commit messages. These examples demonstrate the use of type and scope for different types of changes. ```text fix(combo-box): close dropdown on outside click docs(tree-view): fix slottable inline editing example chore(deps-dev): bump vitest, svelte-check ``` -------------------------------- ### Basic Session Storage Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/SessionStorage.svx Demonstrates basic state persistence within a browser session. State is maintained across refreshes but cleared when the tab is closed. ```javascript

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. ```svelte

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.

``` -------------------------------- ### Conventional Commit Message with Body Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Demonstrates a conventional commit message that includes an optional body for additional context. This example shows how to explain the changes and reference related issues. ```text fix(data-table): associate cells with column headers Cells now set aria-labelledby to their column header id. Fixes #3162 ``` -------------------------------- ### Composed Modal Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ComposedModal.svx A basic example of a composed modal with a header, body, and footer. This component is used for focused interactions requiring user attention or input. ```svelte

This is the modal body content.

``` -------------------------------- ### Multiple MultiSelect Dropdowns Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/MultiSelect.svx Illustrates how to manage the state of multiple MultiSelect dropdowns within a form, ensuring coordinated behavior. ```svelte ``` -------------------------------- ### Number Input Stepper Events Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/NumberInput.svx Demonstrates various stepper events for NumberInput, including clicks and blur events on stepper buttons. ```svelte { console.log('Stepper clicked:', e.detail.direction, e.detail.value); }} on:blur:stepper={(e) => { console.log('Stepper blurred:', e.detail.direction, e.detail.value); }} /> ``` -------------------------------- ### Export New Component from Index Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Example of adding a new component export to the main index file. This makes the component available for import by consumers. ```diff export { CopyButton } from "./CopyButton"; export { ComboBox } from "./ComboBox"; + export { FixedComboBox } from "./FixedComboBox"; export { ComposedModal, ModalHeader, ModalBody, ModalFooter, } from "./ComposedModal"; ``` -------------------------------- ### Basic Theme Component Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Theme.svx Create a basic theme component that can be controlled programmatically. This snippet demonstrates the fundamental setup for the Theme component. ```svelte ``` -------------------------------- ### Progress Modal Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ComposedModal.svx Combines a composed modal with a progress indicator for multi-step flows. The modal footer can render Cancel, Previous, and Next buttons, with labels updating on the final step. ```svelte {#if currentStep === 0}

Content for step 1.

{:else if currentStep === 1}

Content for step 2.

{:else}

Content for step 3.

{/if}
(currentStep -= 1)} on:click:primary={() => { if (currentStep === steps.length - 1) { open = false; } else { currentStep += 1; } }} />
``` -------------------------------- ### Basic DataTable Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/DataTable.svx Use this for displaying structured data in a tabular format. Ensure 'headers' objects have unique 'key' properties and 'rows' objects have unique 'id' properties. ```svelte ``` -------------------------------- ### ContentSwitcher with Custom Switch Slot Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ContentSwitcher.svx Demonstrates customizing the appearance of individual switches by using slots. This example includes icons alongside text for each switch. ```svelte Latest news Trending ``` -------------------------------- ### Full File Uploader with Multiple Files and Status Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FileUploader.svx Combines a button trigger with a list of uploaded files. This example accepts multiple JPEG files and displays them in a completed state. ```svelte ``` -------------------------------- ### Create a Form with Various Controls Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Form.svx Use the Form and FormGroup components to structure related form elements. This example includes checkboxes, radio buttons, and a select menu. ```svelte
``` -------------------------------- ### FloatingPortal Slot Direction Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FloatingPortal.svx Demonstrates how to use the `direction` slot prop to read the actual rendered direction after auto-flipping. This is useful for conditional logic and styling. ```svelte {#if open}

This is a tooltip.

Rendered direction: {direction}

{/if} ``` -------------------------------- ### Display multi-line code with expand/collapse Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/CodeSnippet.svx Use `type="multi"` to display longer code blocks that can be expanded or collapsed. This improves readability for extensive code examples. ```svelte ``` -------------------------------- ### Default Inline Loading Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/InlineLoading.svx Displays a basic loading indicator with the default configuration. No specific setup is required beyond importing the component. ```svelte ``` -------------------------------- ### Basic Notification Queue Usage Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/NotificationQueue.svx Use `bind:this` to get a reference to the queue instance, then call `add()` to show notifications. The queue automatically manages positioning and removes notifications when they timeout or are closed. ```svelte ``` -------------------------------- ### FloatingPortal Custom Target Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FloatingPortal.svx Illustrates how to use the `target` prop to mount floating content into a specific DOM element instead of the default `document.body`. Positioning is always driven by the anchor. ```svelte
Target Element
{#if open}
This content is portalled to the red div.
{/if} ``` -------------------------------- ### Custom Starting Heading Level Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Heading.svx Use the 'level' prop on the Section component to specify a custom starting heading level. Child sections will increment from this custom level. ```svelte
Starts at Heading 5
Heading 6
``` -------------------------------- ### Dynamic Theming with 'all.css' Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/README.md Import 'all.css' and set the 'theme' attribute on the html element to switch themes programmatically. ```js import "carbon-components-svelte/css/all.css"; ``` ```html ... ``` ```html ``` -------------------------------- ### Serve Built Fixtures Locally Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Serves the statically built fixtures using Vite's preview server. This command is used after building the fixtures to replicate the CI serving environment. ```sh bunx vite preview --config e2e/vite.config.ts ``` -------------------------------- ### Dynamic Theming with all.css Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/content/overview.md Import 'all.css' for dynamic, client-side theming. Programmatically switch themes by setting the 'theme' attribute on the HTML element. ```svelte ``` -------------------------------- ### Enable Batch Expansion in DataTable Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/DataTable.svx Set `batchExpansion` to `true` to allow users to expand and collapse all rows simultaneously. This example demonstrates a basic DataTable with batch expansion enabled. ```svelte
{JSON.stringify(row, null, 2)}
``` -------------------------------- ### Installing Svelte 3 and Svelte 4 Compatibility Dependencies Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Before running compatibility tests for Svelte 3 or Svelte 4, install the specific workspace dependencies. This ensures the tests run against the correct Svelte version and avoids falling back to the Svelte 5 harness. ```shell cd tests-svelte3 && bun install cd ../tests-svelte4 && bun install ``` -------------------------------- ### FloatingPortal Inside Native Dialog Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FloatingPortal.svx Shows how floating content is automatically mounted into a native dialog when the anchor is inside it. This ensures the content remains visible and interactive within the dialog's top layer. ```svelte

Dialog content

{#if open}
This content is portalled into the dialog.
{/if}
``` -------------------------------- ### Disabled File Uploader Example Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FileUploader.svx Disable the file uploader by setting the `disabled` prop to `true`. ```svelte ``` -------------------------------- ### Responsive Column Sizing Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Grid.svx Demonstrates how to create responsive layouts by adjusting column spans across different breakpoints (sm, md, lg). Ensure column spans are scaled proportionally to the total columns at each breakpoint. ```svelte ``` ```svelte ``` ```svelte ``` -------------------------------- ### Create a Basic Tile Container Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Tile.svx Use the default Tile component to create a basic container for your content. ```svelte Content ``` -------------------------------- ### Importing All CSS for Theming Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Theme.svx Ensure you import the `all.css` stylesheet to enable dynamic theming using CSS variables. ```css import "carbon-components-svelte/css/all.css"; ``` -------------------------------- ### Vertical Stack Align Start Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Stack.svx Aligns items to the left in a vertical stack. Uses a gap of 2. ```svelte
Narrow
Wider item
Medium
``` -------------------------------- ### Clearing Local Storage Items Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/LocalStorage.svx Demonstrates how to use the `clearItem` and `clearAll` methods to manage stored data. Access these methods using `bind:this`. ```svelte

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'. ```svelte

Start

End

Center

``` -------------------------------- ### Multiple Modals Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Modal.svx Demonstrates stacking multiple modals for complex workflows, where each modal maintains its own state and focus management. ```svelte

Content for the first modal.

Content for the second modal.

``` -------------------------------- ### Horizontal Stack Align Start Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Stack.svx Aligns items to the top in a horizontal stack with a height of 120px. Uses a gap of 2. ```svelte
Short
Taller item
Short
``` -------------------------------- ### TreeView Show Node with Options Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/TreeView.svx Configures the behavior of the `showNode()` method using optional parameters. By default, it expands, selects, and focuses a node. Options allow disabling any combination of these actions, such as expanding without selecting. ```svelte ``` -------------------------------- ### Left-Aligned Chevron Accordion Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Accordion.svx Shows how to align the chevron icon to the left of the accordion item by setting the `align` prop to 'start'. ```svelte

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.

``` -------------------------------- ### Header with Toast Notification Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/UIShell.svx Integrate toasts with the UI Shell. This example triggers a toast, which appears in the top right corner, below the header. ```svelte
{ /* handle close */ }} /> ``` -------------------------------- ### Tabs with Icons Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Tabs.svx Demonstrates how to use icons with container type tabs. Ensure icons are imported and passed to the `icon` prop. ```svelte Calendar content Information content Settings content ``` -------------------------------- ### Horizontal Stack Justify Space Between Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Stack.svx Distributes items evenly with the first item at the start and the last item at the end in a horizontal stack. ```svelte
Item 1
Item 2
Item 3
``` -------------------------------- ### FloatingPortal with Intrinsic Alignment Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FloatingPortal.svx Positions the floating box along the anchor when intrinsicWidth is true. Supports 'start', 'center', and 'end' alignment. ```svelte

This is floating content.

``` -------------------------------- ### Bind to Breakpoint Size Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Breakpoint.svx Bind to the `size` prop to get the current breakpoint. The `on:change` event fires when the size is determined and when it changes. ```svelte

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. ```svelte Restart all API documentation Stop all ``` -------------------------------- ### Clone the Repository Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Clone your fork of the repository and navigate into the project directory. ```sh git clone cd carbon-components-svelte ``` -------------------------------- ### JSDoc for Component Prop Type Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/CONTRIBUTING.md Example of using JSDoc to specify the type for a component prop. This is read by sveld for generating API documentation. ```js /** * Specify the size of the component * @type {"sm" | "default" | "lg"} */ export let size = "default"; ``` -------------------------------- ### Basic Header Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/UIShell.svx Create a basic header using the Header component. ```svelte
``` -------------------------------- ### Number Input with Custom Step Value Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/NumberInput.svx Controls the increment/decrement step size using the `step` prop. This example demonstrates a step of 0.1. ```svelte ``` -------------------------------- ### Reactive Key for User Preferences Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/LocalStorage.svx Shows how to use a reactive `key` prop to manage separate storage entries, ideal for per-user settings. Switching keys hydrates `value` but does not dispatch an `on:update` event. ```svelte

Current 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
This content is rendered in a portal.
``` -------------------------------- ### Non-English Locale (German) Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/DatePicker.svx Use a non-English locale by importing the corresponding module from `flatpickr/dist/l10n/` and passing it to the `locale` prop. This example uses German. ```svelte ``` -------------------------------- ### Create a basic PaginationNav Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/PaginationNav.svx Use the default PaginationNav component for a basic pagination interface. No additional props are required for default functionality. ```svelte ``` -------------------------------- ### ContentSwitcher with Initial Selection Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ContentSwitcher.svx Sets the initially selected switch using the 'selectedIndex' prop. This example pre-selects the second switch (index 1). ```svelte ``` -------------------------------- ### Tooltip Definition Alignment Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/TooltipDefinition.svx Align the tooltip content horizontally relative to the anchor using the `align` prop. Options are 'start', 'center', and 'end'. ```svelte Start Center End ``` -------------------------------- ### Number Input with Helper Text Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/NumberInput.svx Includes descriptive text below the input field using the `helperText` prop to guide users on expected input. ```svelte ``` -------------------------------- ### Basic Context Menu Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ContextMenu.svx Displays a basic context menu that appears on right-click. Use ContextMenuItem for menu items and ContextMenuDivider for visual separation. Ensure the root element has a meaningful label for accessibility. ```svelte ``` -------------------------------- ### Default Grid Layout Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Grid.svx Creates a basic grid layout with equally sized columns. Use this for standard content structuring. ```svelte Column 1 Column 2 Column 3 Column 4 ``` -------------------------------- ### Typeahead ComboBox with Custom Filter Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/ComboBox.svx Override the default typeahead filtering logic with a custom 'shouldFilterItem' function. This example implements a simple fuzzy filter. ```svelte ``` -------------------------------- ### Select Small Size Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Select.svx Use the small size variant (`size="sm"`) for compact layouts. ```svelte ``` -------------------------------- ### Flatpickr Options: Show Months Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/DatePicker.svx Pass additional Flatpickr options via `flatpickrProps`. This example sets `showMonths` to display two months side-by-side. ```svelte ``` -------------------------------- ### Display a single-line code snippet Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/CodeSnippet.svx Use the default CodeSnippet component to display a single line of code. This is useful for commands or short code examples. ```svelte ``` -------------------------------- ### Override Copy Functionality Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/CopyButton.svx Provide a custom function to the `copy` prop to replace the default Clipboard API behavior. This example uses the 'clipboard-copy' package. ```svelte ``` -------------------------------- ### File Uploader with Prepend File Ordering Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/FileUploader.svx Set `orderFiles` to 'prepend' to show the newest uploads first instead of appending them to the end. ```svelte ``` -------------------------------- ### Header with Utilities Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/UIShell.svx Include utility components in the header using `HeaderUtilities`. ```svelte
``` -------------------------------- ### Multiple Independent Portals Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Portal.svx Demonstrates how multiple Portal instances can be used independently. Each instance creates its own element in the document body and is automatically cleaned up when removed. ```svelte
Portal 1
Portal 2
``` -------------------------------- ### Skeleton Accordion with Left-Aligned Chevron Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Accordion.svx The skeleton state can be combined with the left-aligned chevron style by setting both the `skeleton` and `align="start"` props. ```svelte ``` -------------------------------- ### Initial Selected Items in MultiSelect Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/MultiSelect.svx Pre-select items in the multi-select dropdown by providing an array of item IDs to the `selectedIds` prop. This example pre-selects 'Slack' and 'Email'. ```svelte ``` -------------------------------- ### Small Toolbar Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Toolbar.svx Configure a compact toolbar using the `size="sm"` prop. This is useful for space-constrained interfaces. ```svelte ``` -------------------------------- ### Inline Loading with Description Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/InlineLoading.svx Add descriptive text to provide context about the loading operation. This helps users understand what is happening. ```svelte ``` -------------------------------- ### Custom Locale Object Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/DatePicker.svx Customize weekday labels by passing a `CustomLocale` object to the `locale` prop. This example restores flatpickr's default English shorthands. ```svelte ``` -------------------------------- ### Pagination Skeleton Loader Source: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/src/pages/components/Pagination.svx Use the `PaginationSkeleton` component to display a loading state for the pagination controls. This is useful while data is being fetched. ```svelte ```