Commands
Utilities
Utility command components for common action patterns.
Utilities are opinionated, reusable command components built on top of primitives.
They include built-in labels, icons, and confirmation copy. Use primitives instead when a screen needs custom copy, custom styling, or a different interaction flow.
ArchiveCommand
What it is:
- prebuilt archive action using
CommandClick
Good for:
- soft-delete/archive flows for bulk or single selections
<ArchiveCommand
variables={{ ids: data.map((item) => item.id) }}
mutation={orpc.projects.archive.mutationOptions({ onSuccess: () => {} })}
/>RestoreCommand
What it is:
- prebuilt restore action for previously archived items
Good for:
- archive pages and recovery workflows
<RestoreCommand
variables={{ ids: data.map((item) => item.id) }}
mutation={orpc.projects.restore.mutationOptions({ onSuccess: () => {} })}
/>DeleteCommand
What it is:
- prebuilt destructive action with confirmation dialog
Good for:
- irreversible delete actions where confirmation is required
<DeleteCommand
variables={{ ids: data.map((item) => item.id) }}
mutation={orpc.projects.delete.mutationOptions({ onSuccess: () => {} })}
/>SingleDeleteCommand
What it is:
- typed convenience wrapper of
DeleteCommandfor{ id: string }
Good for:
- detail pages that delete one entity at a time
<SingleDeleteCommand
variables={{ id: data.id }}
mutation={orpc.projects.deleteOne.mutationOptions({ onSuccess: () => {} })}
/>When to use utilities vs primitives
- use utilities when default behavior matches your use case
- use primitives when interaction or copy needs customization
- use primitives when built-in Dutch labels or destructive copy do not fit the product context
Utilities help keep common destructive/archive flows consistent across modules.