ContentSwitcher

Source code

Usage

Default

<script>
  import { ContentSwitcher, Switch } from "carbon-components-svelte";
</script>

<ContentSwitcher>
  <Switch text="Switch 1" />
  <Switch text="Switch 2" />
  <Switch text="Switch 3" />
</ContentSwitcher>

Light variant

<script>
  import { ContentSwitcher, Switch } from "carbon-components-svelte";
</script>

<ContentSwitcher light>
  <Switch text="Switch 1" />
  <Switch text="Switch 2" />
  <Switch text="Switch 3" />
</ContentSwitcher>

Custom switch slot

<script>
  import { ContentSwitcher, Switch } from "carbon-components-svelte";
  import Add16 from "carbon-icons-svelte/lib/Add16";
</script>

<ContentSwitcher>
  <Switch>
    <div style="display: flex; align-items: center;">
      Third section
      <Add16 style="margin-left: .25rem;" />
    </div>
  </Switch>
  <Switch text="Switch 2" />
</ContentSwitcher>

Disabled

<script>
  import { ContentSwitcher, Switch } from "carbon-components-svelte";
</script>

<ContentSwitcher>
  <Switch text="Switch 1" disabled />
  <Switch text="Switch 2" disabled />
</ContentSwitcher>