Skip to content
Design System
GitHub

Permission scopes to grant, grouped by resource and bounded by what the viewer holds: a scope outside `allowedScopes` is listed, disabled, with the reason.

What it may do
Devices
Webhooks
Members

1 scope selected

A key never holds more than you do.

Bounded

Install
npx shadcn add @syncrobotic/scope-picker

Also installs: @syncrobotic/cn, @syncrobotic/format-number, @syncrobotic/checkbox, @syncrobotic/choice-field, @syncrobotic/code, @syncrobotic/radio-group

Overview

When to use

  • An API key's or a service account's scopes.
  • Any grant of permission strings that must stay within what the person granting holds.

Use something else

  • A role with its bundle: a Select of roles, as users-roles does.
  • A few unrelated options: Choice field in a FieldSet.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Allow all

Zh tw

Usage rules

  • Pass allowedScopes from the viewer's own permissions: nobody grants what they do not hold. The rest stay listed, disabled, with the reason, so people see what exists.
  • Scopes are permission strings, grouped by the part before ":" (resource to override); resourceLabels names the groups.
  • allowAll only where the server stores "all, including ones added later" (null); never send every string as a stand-in for it.
  • Before you send, boundScopes drops anything out of bounds that came in with the value.

Changelog

  • 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
  • 0.57.02026-11-27First release: scopes grouped by resource with a checkbox per group, bounded by allowedScopes (the rest disabled with the reason), and with allowAll a choice of "all, including ones added later" apart from ticking every box; boundScopes, groupScopes.

How to upgrade