Repository Select
A select for one git repository out of several: the trigger shows the name, each option its path, the branch checked out and its state (uncommitted, ahead, behind, no remote, up to date). On UI SDK Select, so keyboard, typeahead and agents work as in any select.
Example
repository-select-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
Use it to pick one git repository out of several in a workspace: each option shows the path, the branch checked out and whether it has uncommitted files, is ahead or behind its upstream, or has no remote. Put it in CommitHistory's headerStart with size="sm", or in a Field with a FieldLabel.
API reference
RepositorySelect
| Prop | Type | Default |
|---|---|---|
valueThe chosen repository's `value`. | string | null | – |
defaultValue | string | null | – |
onValueChange | (value: string | null, details: ChangeDetails<SelectValueChangeReason>) => void | – |
open | boolean | – |
defaultOpen | boolean | – |
onOpenChange | SelectProps<string>["onOpenChange"] | – |
disabled | boolean | – |
name | string | – |
repositoriesrequired | readonly Repository[] | – |
aria-labelNames the trigger when no `FieldLabel` does. | string | – |
size`sm` for a header or toolbar, like CommitHistory's `headerStart`. | SelectSize | – |
labels | Partial<RepositorySelectLabels> | – |
triggerProps | Omit<SelectTriggerProps, "children"> | – |
contentClassName | string | – |
Other exports
repositorySelectLabelstype Repositorytype RepositorySelectLabelstype RepositorySelectPropsAccessibility
- UI SDK's select: arrows, Home/End and typeahead by name; Enter or Space chooses.
- Each state is a word on a badge ("5 uncommitted", "No remote"), never colour alone.
Agent actions
Agents read the repositories as the select's options and choose one with setValue, by value or name.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.