TidalUI

Workspace switcher preview

Search and switch among consumer-owned workspaces with exact roles, statuses, form values, and native create or manage destinations.

pro · Navigation · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/workspace-switcher

Import components/ui/tidal.css, components/ui/workspace-switcher.css. Wrap installed components in tidal-scope.

Preview

Workspace switcher component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/workspace-switcher.css";
import{TidalWorkspaceSwitcher}from"./components/ui/workspace-switcher";
export default(p:Parameters<typeof TidalWorkspaceSwitcher>[0])=><div className="tidal-scope"><TidalWorkspaceSwitcher {...p}/></div>;

API and props

TidalWorkspaceSwitcher.activeWorkspaceId (required)
string | null

Required active workspace id value accepted by this exported component.

TidalWorkspaceSwitcher.label (required)
ReactNode

Required label value accepted by this exported component.

TidalWorkspaceSwitcher.onHighlightedWorkspaceChange (required)
(workspaceId: string | undefined, event: TidalComboboxActiveEvent) => void

Callback invoked when the highlighted workspace change interaction is proposed.

TidalWorkspaceSwitcher.onOpenChange (required)
(open: boolean, event: TidalComboboxOpenEvent) => void

Callback invoked when the open change interaction is proposed.

TidalWorkspaceSwitcher.onQueryChange (required)
(value: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the query change interaction is proposed.

TidalWorkspaceSwitcher.onWorkspaceChange (required)
(workspace: TidalWorkspaceOption, event: TidalComboboxSelectionEvent) => void

Callback invoked when the workspace change interaction is proposed.

TidalWorkspaceSwitcher.open (required)
boolean

Required open value accepted by this exported component.

TidalWorkspaceSwitcher.query (required)
string

Required query value accepted by this exported component.

TidalWorkspaceSwitcher.workspaces (required)
ReadonlyArray<TidalWorkspaceOption>

Required workspaces value accepted by this exported component.

TidalWorkspaceSwitcher.createDisabled
boolean | undefined

Optional create disabled value accepted by this exported component.

TidalWorkspaceSwitcher.createHref
string | undefined

Optional create href value accepted by this exported component.

TidalWorkspaceSwitcher.createLabel
ReactNode

Optional create label value accepted by this exported component.

TidalWorkspaceSwitcher.createLinkProps
DestinationProps | undefined

Optional create link props value accepted by this exported component.

TidalWorkspaceSwitcher.createLinkRef
Ref<HTMLAnchorElement> | undefined

Optional create link ref value accepted by this exported component.

TidalWorkspaceSwitcher.description
ReactNode

Optional description value accepted by this exported component.

TidalWorkspaceSwitcher.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalWorkspaceSwitcher.emptyMessage
ReactNode

Optional empty message value accepted by this exported component.

TidalWorkspaceSwitcher.error
ReactNode

Optional error value accepted by this exported component.

TidalWorkspaceSwitcher.form
string | undefined

Optional form value accepted by this exported component.

TidalWorkspaceSwitcher.hiddenInputProps
Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "form" | "name" | "type" | "value" | "defaultValue" | "children" | "dangerouslySetInnerHTML" | "readOnly"> | undefined

Optional hidden input props value accepted by this exported component.

TidalWorkspaceSwitcher.hiddenInputRef
Ref<HTMLInputElement> | undefined

Optional hidden input ref value accepted by this exported component.

TidalWorkspaceSwitcher.highlightedWorkspaceId
string | undefined

Optional highlighted workspace id value accepted by this exported component.

TidalWorkspaceSwitcher.hint
ReactNode

Optional hint value accepted by this exported component.

TidalWorkspaceSwitcher.inputProps
Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "type" | "value" | "defaultValue" | "role" | "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-readonly" | "children" | "dangerouslySetInnerHTML" | "placeholder" | "readOnly"> | undefined

Optional input props value accepted by this exported component.

TidalWorkspaceSwitcher.inputRef
Ref<HTMLInputElement> | undefined

Optional input ref value accepted by this exported component.

TidalWorkspaceSwitcher.labels
Partial<{ listbox: string; open: string; close: string; selected: ReactNode; noSelection: ReactNode; readOnly: ReactNode; searchPlaceholder: string; invalid: ReactNode; outsideResults: ReactNode; }> | undefined

Optional labels value accepted by this exported component.

TidalWorkspaceSwitcher.manageDisabled
boolean | undefined

Optional manage disabled value accepted by this exported component.

TidalWorkspaceSwitcher.manageHref
string | undefined

Optional manage href value accepted by this exported component.

TidalWorkspaceSwitcher.manageLabel
ReactNode

Optional manage label value accepted by this exported component.

TidalWorkspaceSwitcher.manageLinkProps
DestinationProps | undefined

Optional manage link props value accepted by this exported component.

TidalWorkspaceSwitcher.manageLinkRef
Ref<HTMLAnchorElement> | undefined

Optional manage link ref value accepted by this exported component.

TidalWorkspaceSwitcher.name
string | undefined

Optional name value accepted by this exported component.

TidalWorkspaceSwitcher.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalWorkspaceSwitcher.toggleButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-label" | "children" | "dangerouslySetInnerHTML"> | undefined

Optional toggle button props value accepted by this exported component.

TidalWorkspaceSwitcher.toggleButtonRef
Ref<HTMLButtonElement> | undefined

Optional toggle button ref value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas