Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Permission Roles Carousel Block for Ark UI

Five access roles for an access-control tool, one per swipeable slide, each with seven real permission checkboxes that tick the ones they need, a derived count, a Custom mark when a preset is changed and a Reset to preset button.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show what each role can do without a wide matrix, with this permission roles carousel for React with Ark UI. Rolecall, an access-control tool, has five roles (Admin, Editor, Reviewer, Billing and Viewer) on one ruled track, one role per slide. Each slide lists seven permissions as real Checkboxes, each with a hint that says what it needs, and counts what the role can do ("Can do 4 of 7") from the ticks. Permissions depend on each other: ticking Publish ticks Edit content and View projects, clearing Edit content clears Publish and Delete content, and the status line says which others moved. A role that no longer matches its preset shows a "Custom" mark and a "Reset to preset" Button. A band above the track sums up every role with its count and a "Custom" word, each a button that jumps to the role, and the foot holds the status line, a dot for each role, and Previous and Next. The ruled bands come from Guides. Rolecall, the roles and the people counts are made up for the example.

FAQ

How do I use my own roles and permissions?

Edit PERMS and ROLES. A permission has an id, a label and the ids it needs; a role has an id, a label, a people count, a sentence and the preset of permission ids it starts with. The counts, the hints, the Custom mark and the dependency rules are all derived from those two lists, so nothing is typed twice.

How do the dependencies work?

Ticking a permission also ticks everything it needs, and clearing one also clears everything that needs it, following the chain in both directions. The status line names the others that moved ("Delete content turned off. Also off: Publish"), so nothing changes silently. The rule lives in nextGrant, which you can replace with your own.

When does a role show Custom?

When its ticks differ from its preset in any way. The mark has a reserved place in the slide header, so it appears without moving anything, and "Reset to preset" puts the preset back. If the role already matches, the button stays in place and the status line says so.

How does it work with a keyboard?

Tab reaches the role buttons above the track, then the checkboxes and the reset button of the role in view, then the dots, Previous and Next. Space ticks a checkbox. Each checkbox is named with its role and its permission ("Editor: Publish") and described by what it needs. Roles that are out of view are hidden from the tab order and from screen readers.

Why doesn't ticking a box swipe the track?

The permission list and the reset button sit in a box marked data-no-drag, and the track ignores a drag that starts in one. The Carousel's mouse drag is off and the controls take touch-action: pan-y.

What stays local in the demo?

Everything. The roles are typed example data, ticks only change this page, and nothing is saved. To wire it for real, load each role's grants into START, and make tick and reset save the grant to your API before they update the list.