Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Department Setup Onboarding Block for Svelte

A directory step where departments are added by name or in one press, renamed in place and removed with undo, with a total that counts the people in them.

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

Let a new user set up the departments their people will be filed under, with this departments step for Svelte with Ark UI. It is a step of Rosterhurst, an HR directory, as a whole screen: the page's rails and one band across it, the step header (“Step 4 of 6” and a hairline), the heading and one framed card in three bands. The first band adds a department by name, with Enter or the Add button, and has typical ones (Sales, Support, Finance) one press away. The second is the list: each row has a name you can edit in place with an Editable, how many people are in it, and Remove. Remove turns the row into a quiet “Design removed” line with Undo, of the same height. The third band counts the total: “21 people in 3 departments”. Continue is the one Shine Button, with a ghost Skip for now.

FAQ

Why does a removed row stay?

So nothing moves. Remove turns the row into “Design removed.” with an Undo button inside the same 56-pixel row, and focus goes to that button. Undo brings the department back and focus returns to its pencil. A removed row does not count: the total drops at once. Adding a department when the list is full lets the oldest removed row go.

What does it refuse?

An empty name, a name that is already there (capitals aside), and more than eight rows. Typing the name of a removed department brings it back instead of adding a copy. Each refusal is said under the field, in a slot that is always reserved, and in the status. Names stop at 28 characters.

Where do the people counts come from?

They are typed: the three starting departments carry 12, 5 and 4 people, and the typical ones carry example counts. A department you type yourself starts with “No people yet”. The total is worked out from the rows that are kept, so it is never typed twice.

How does it work with the keyboard?

Enter in the name field adds the department without sending the step. Each row's pencil opens its name: Enter keeps it and Escape puts the old one back. Remove and Undo are named for the department (“Remove Design”). The list is a region of fixed height that scrolls when it is full.

What stays local in the demo, and how do I wire it?

Everything. The departments and their counts live in the tab and Continue only says “Saved in this demo. Nothing was stored.” In your app create the departments where submit says so, and take the people counts from your directory.

How does it look on a phone?

The same, in one column: the heading's sentence is kept for screen readers only, the list keeps its height and scrolls, and Continue pins to the foot of the screen with Skip for now beside it.