Skip to content
Design System
GitHub

Project switcher

v0.64.0, changelogBeta

The current project, and a searchable list to switch to another: recent first, then all of them or the server's matches, with New project at the end.

API reference

Generated from the types. Every part also takes className.

ProjectSwitcher

projectsrequired
readonly SwitcherProject[]The projects to list: all of them, or the server's matches for search.
current
{ id: string; name: string; detail?: string } | nullThe project the page shows. It may be outside projects (a search result list): it still names the trigger.
recent
readonly SwitcherProject[] = []Most recent first; shown above the list while nothing is typed.
onSelectrequired
(project: SwitcherProject) => void
search
stringWith onSearchChange, the server searches: the list shows projects as given and filters nothing itself.
onSearchChange
(search: string) => void
loading
booleanA server search is under way.
onCreate
() => voidShows "New project" at the end; hide it from a viewer who may not create one.
onViewAll
() => void
mark
(project: SwitcherProject) => ReactNodeThe mark before a name (a logo); default its first letter on a tile.
open
booleanOpen from outside (a shortcut of your own); leave both out and the trigger opens it.
onOpenChange
(open: boolean) => void
defaultOpen
boolean = false
labels
Partial<ProjectSwitcherLabels>