Skip to content
WunderUI

Scope List

Pro

What an agent asks to access, one scope per row with an icon, a title and the exact target, and a countdown until the request lapses.

Playground

Requested access

Expires in
  • Read the docs appapps/docs · 412 files
  • Edit component filespackages/react/src/components · 198 files
  • Open a pull requestwunder-ui/wunderui · branch tokens-sync

Installation

Scope List comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import { ScopeList } from "@wunderui/react"

Then use it:

tsx
import { ScopeList } from "@wunderui/react"

export function Request({ expiresAt }: { expiresAt: Date }) {
  return (
    <ScopeList
      scopes={[
        { title: "Read the docs app", detail: "apps/docs · 412 files" },
        { title: "Open a pull request", detail: "wunder-ui/wunderui · branch tokens-sync" },
      ]}
      expiresAt={expiresAt}
    />
  )
}

Expected result: You see a card headed Requested access with a timer at the right, then one row per scope. Under a minute the timer turns amber, and at zero it reads Expired in red.

When to use

Use Scope List for

  • The access an agent asks for before it runs, one scope per row
  • What was granted, with a way to revoke each scope next to it
  • A request that lapses, with the time left in the header

Use something else for

Wording

Start the title with the verb the agent will use: read, edit, open, delete. The icon repeats it and the detail names the target in monospace; say when an action cannot be undone.

Read access

  • Read the docs appapps/docs · 412 files
  • Read open pull requestswunder-ui/wunderui · 6 open

Grouping

The list has no groups of its own. For more than four scopes, or when delete sits next to read, use one list per verb and put the least risky group first.

Requested access

  • Read the docs appapps/docs · 412 files
  • Edit component filespackages/react/src/components · 198 files
  • Open a pull requestwunder-ui/wunderui · branch tokens-sync
  • Delete preview brancheswunder-ui/wunderui · preview/* · cannot be undone

Frame

The list draws its own card by default. The bare option drops the frame and padding, for a list inside a surface of your own such as an approval.

Requested access

  • Read the docs appapps/docs · 412 files
  • Open a pull requestwunder-ui/wunderui · branch tokens-sync

Warning time

The warning time is in milliseconds, not a share. The timer turns amber when less than that is left and red once the request has lapsed.

Warn at

Requested access

Expires in
  • Read the docs appapps/docs · 412 files
  • Open a pull requestwunder-ui/wunderui · branch tokens-sync

Detail text and expiry

detailClassName restyles the detail lines (the default is monospace; font-sans suits prose). When expiresAt passes, the list shows the expired state like the Expiry Timer and calls onExpire.

Requested access

  • Read your calendarOnly event titles and times, never the notes.
  • Create eventsOn the calendar you pick.

Keyboard interactions

The list itself is not interactive and handles no keys. Buttons you put in a row, such as Revoke, are native buttons.

TaborShiftTab
Moves between the buttons you put in the rows, in reading order. The list and its timer are not tab stops.
EnterorSpace
Activates the focused button, for example Revoke.

When a button removes its own row, move focus yourself, to the next button or to a status line if none is left. The Examples tab shows how.

Behavior and motion

What the list shows, what its timer does, and what it leaves to you.

Read only
The list only shows scopes: no buttons, no selection, no state. Approve, Reject and Revoke are yours to build around it, and the Examples tab shows each.
Rows
One row per scope, in the order you pass them. A detail can be a plain string for a path or a node with a button.
Timer
With an expiry the header shows Expires in 04:32 and ticks every second. It turns amber when less than a minute is left (adjustable) and reads Expired in red at zero.
Announcements
The timer never reads out the seconds. A screen reader hears Expiring soon once when it turns amber and Expired once when it lapses.
After expiry
The expire callback fires once when time runs out, and nothing changes by itself, so turn the decision off there and say nothing was granted. A new expiry restarts the timer.
Date that cannot be read
An invalid expiry date never ticks. The header reads Expires in with no time and the request never lapses, so pass a valid date or none.
No scopes
An empty list shows just the header, so show a sentence like This run asks for no access instead. The Examples tab shows it.
Long text
Titles and details wrap inside the card, and a long path without spaces breaks too. Nothing is cut off.
Semantics
The section is named by its title, the rows form a list, and icons are hidden from screen readers. Changes are not announced, so say what changed in a status line.
Motion
None. Only the timer text changes, once a second, and reduced motion makes no difference.

Anatomy

The figure shows one scope with a timer. Every row after the first repeats parts 4 to 6, and a hairline above each row separates it from the one before.

Requested access

Expires in
  • Read the docs appapps/docs · 412 files
  • data-slot="scope-list"

    A section named by its title, with a 1 px border, 16 px radius and 16 px padding. The bare option drops all three and leaves only the content.

  • The heading, Requested access by default, in 14 px semibold text. It is the accessible name of the section.

  • Optional

    An Expiry Timer at the right of the header, shown when an expiry is set. It is grey, turns amber shortly before the end and red once the request has lapsed.

  • A 28 px tile with an 8 px radius on the indigo tint, holding a 14 px icon (a shield by default). It is decoration and hidden from screen readers.

  • What the agent asks to do, in 13 px medium text. Start with the verb: read, edit, open, delete.

  • Optional

    The target and how much of it, in 12 px monospace text, such as apps/docs · 412 files. It can hold a node, so a button can sit in it.

Best practices

  • Do

    Start each title with the verb the agent will use: read, edit, open, delete. Readers scan down the verbs before the targets.

  • Do

    Put the target and its size in the detail, in a form people recognise: a path, a branch, a file count. Say there when an action cannot be undone.

  • Do

    Group by verb when there are more than four scopes or a delete sits next to a read. One list per verb, least risky first.

  • Do

    Set an expiry for a request that lapses, and turn Approve and Reject off when it runs out. The list does not disable anything itself.

  • Do

    Give each scope an id when rows can be removed or reordered, so a button inside a row keeps its identity.

  • Don’t

    Don't pre-approve anything or focus Approve when the request opens. The list shows what is asked, and the decision is the person's.

  • Don’t

    Don't fold delete into a broad title such as Full access. Name each action the agent will take.

  • Don’t

    Don't put controls in the title. A button like Revoke goes in the detail and needs an aria-label that names the scope.

API reference

ScopeList is a plain component, so the table lists every prop.

A section named by its title, with a 1 px border, 16 px radius and 16 px padding. The bare option drops all three and leaves only the content.

PropTypeDefaultDescription
scopes requiredScope[]—The scopes, one row each. A scope is : is the key, replaces the shield, is the permission in plain words and is the target, any node.
titleReactNode"Requested access"The heading and the accessible name of the list. Default .
expiresAtDate | string | number—When the request lapses: a , an ISO string or milliseconds since the epoch. Without it there is no timer.
warnAtnumber—Milliseconds left at which the timer turns amber. Default .
onExpire() => void—Called once when the time runs out. A new lets it fire again.
barebooleanfalseDrops the border, the radius and the padding of the card, for a list inside a surface of your own. Default .
classNamestring—Extra classes for the section, for example .
detailClassNamestring—Classes for every detail line, e.g. for prose instead of the monospace default.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("scope-list")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.