This component is still in Beta. Please reach out to Design System team before using it.
<tk-context-switcher class="mb-4x">
<tk-context-switcher-trigger
slot="trigger"
group-name="[Account name]"
item-name="[Workspace name]"
aria-label="workspace menu title"
role="button"
> </tk-context-switcher-trigger>
<tk-context-switcher-menu-group name="Account 1">
<tk-context-switcher-menu-item
name="Workspace A"
link="https://www.usertesting.com/"
initial="A"
>
</tk-context-switcher-menu-item>
<tk-context-switcher-menu-item
name="Workspace How do we handle really long strings that we cause wrapping?"
link="https://www.usertesting.com/"
initial="B"
active
>
<tk-badge type="info" slot="badge">Private</tk-badge>
</tk-context-switcher-menu-item>
</tk-context-switcher-menu-group>
<tk-context-switcher-menu-group name="Account 2">
<tk-context-switcher-menu-item
name="Workspace C"
link="https://www.usertesting.com/"
initial="C"
>
</tk-context-switcher-menu-item>
<tk-context-switcher-menu-item
name="Workspace D"
link="https://www.usertesting.com/"
initial="D"
>
</tk-context-switcher-menu-item>
<tk-context-switcher-menu-item
name="Workspace E"
link="https://www.usertesting.com/"
initial="E"
>
<tk-badge type="info" slot="badge">Private</tk-badge>
</tk-context-switcher-menu-item>
<tk-context-switcher-menu-item
name="Workspace F"
link="https://www.usertesting.com/"
initial="F"
>
<tk-badge type="info" slot="badge">Private</tk-badge>
</tk-context-switcher-menu-item>
</tk-context-switcher-menu-group>
<tk-context-switcher-footer-menu slot="footer-menu">
<tk-context-switcher-footer-item>
<button class="context-switcher-footer-item__link" type="button">Create workspace</button>
</tk-context-switcher-footer-item>
<tk-context-switcher-footer-item>
<a class="context-switcher-footer-item__link" href="#">Manage workspaces</a>
</tk-context-switcher-footer-item>
<tk-context-switcher-footer-item>
<a class="context-switcher-footer-item__link" href="#">Account settings</a>
</tk-context-switcher-footer-item>
</tk-context-switcher-footer-menu>
</tk-context-switcher>
<!-- don't include this (for demo purposes only). -->
<img src="/images/context-switcher-example.png" alt="Example of context switcher rendered in browser.">
<!-- end of ignore -->
Currently there’s no other use case for using this than together with tk-sidebar-nav
. For this reason an example is best viewed on a standalone view. See full-page example.