BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/diceui/radix/stepper

stepper

diceui-radix/stepper
FreeComponent

diceui/radix publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/radix-nova/stepper.json

Source

ui/stepper.tsxraw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/radix-nova/stepper.json · first 6 KB
1"use client";
2
3import { Check } from "lucide-react";
4import {
5 Direction as DirectionPrimitive,
6 Slot as SlotPrimitive,
7} from "radix-ui";
8import * as React from "react";
9import { useComposedRefs } from "@/lib/compose-refs";
10import { cn } from "@/lib/utils";
11import { useAsRef } from "@/registry/bases/radix/hooks/use-as-ref";
12import { useIsomorphicLayoutEffect } from "@/registry/bases/radix/hooks/use-isomorphic-layout-effect";
13import { useLazyRef } from "@/registry/bases/radix/hooks/use-lazy-ref";
14
15const ROOT_NAME = "Stepper";
16const LIST_NAME = "StepperList";
17const ITEM_NAME = "StepperItem";
18const TRIGGER_NAME = "StepperTrigger";
19const INDICATOR_NAME = "StepperIndicator";
20const SEPARATOR_NAME = "StepperSeparator";
21const TITLE_NAME = "StepperTitle";
22const DESCRIPTION_NAME = "StepperDescription";
23const CONTENT_NAME = "StepperContent";
24const PREV_NAME = "StepperPrev";
25const NEXT_NAME = "StepperNext";
26
27const ENTRY_FOCUS = "stepperFocusGroup.onEntryFocus";
28const EVENT_OPTIONS = { bubbles: false, cancelable: true };
29const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
30
31type Direction = "ltr" | "rtl";
32type Orientation = "horizontal" | "vertical";
33type NavigationDirection = "next" | "prev";
34type ActivationMode = "automatic" | "manual";
35type DataState = "inactive" | "active" | "completed";
36
37interface DivProps extends React.ComponentProps<"div"> {
38 asChild?: boolean;
39}
40interface ButtonProps extends React.ComponentProps<"button"> {
41 asChild?: boolean;
42}
43
44type ListElement = React.ComponentRef<typeof StepperList>;
45type TriggerElement = React.ComponentRef<typeof StepperTrigger>;
46
47function getId(
48 id: string,
49 variant: "trigger" | "content" | "title" | "description",
50 value: string,
51) {
52 return `${id}-${variant}-${value}`;
53}
54
55type FocusIntent = "first" | "last" | "prev" | "next";
56
57const MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {
58 ArrowLeft: "prev",
59 ArrowUp: "prev",
60 ArrowRight: "next",
61 ArrowDown: "next",
62 PageUp: "first",
63 Home: "first",
64 PageDown: "last",
65 End: "last",
66};
67
68function getDirectionAwareKey(key: string, dir?: Direction) {
69 if (dir !== "rtl") return key;
70 return key === "ArrowLeft"
71 ? "ArrowRight"
72 : key === "ArrowRight"
73 ? "ArrowLeft"
74 : key;
75}
76
77function getFocusIntent(
78 event: React.KeyboardEvent<TriggerElement>,
79 dir?: Direction,
80 orientation?: Orientation,
81) {
82 const key = getDirectionAwareKey(event.key, dir);
83// … truncated

What it pulls in

npm packages

  • radix-ui

Other registry items

  • button
  • @diceui/use-as-ref
  • @diceui/use-isomorphic-layout-effect
  • @diceui/use-lazy-ref

Files it writes

  • ui/stepper.tsx
  • lib/compose-refs.ts

Facts

Registry
diceui/radix
Type
registry:ui
Access
Free
Files written
2
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

www.diceui.com sadmann7/diceui on GitHub Raw registry item This item as JSON

More from diceui/radix

All 58 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
action-baraction-bardiceui/radixComponentsFree1 dep · 2 files
angle-sliderangle-sliderdiceui/radixComponentsFree1 dep · 3 files
avatar-groupavatar-groupdiceui/radixComponentsFree1 dep
badge-overflowbadge-overflowdiceui/radixComponentsFree1 dep · 2 files
bannerbannerdiceui/radixComponentsFree1 dep
checkbox-groupcheckbox-groupdiceui/radixComponentsFree1 dep
circular-progresscircular-progressdiceui/radixComponentsFree1 dep
client-onlyclient-onlydiceui/radixComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex