BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/better-auth-ui/admin

Admin

better-auth-ui/admin
FreeComponent

Admin plugin integration that adds a stop-impersonating action to the user button while an administrator is impersonating another user.

Live preview

live · rendered by the registry
Rendered by better-auth-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://better-auth-ui.com/r/admin.json

Source

src/components/auth/admin/stop-impersonating.tsxbetter-auth-ui.com/r/admin.json
1"use client"
2
3import { isImpersonatingSession } from "@better-auth-ui/core/plugins"
4import {
5 type AdminAuthClient,
6 useAuth,
7 useAuthPlugin,
8 useSession,
9 useStopImpersonating
10} from "@better-auth-ui/react"
11import { UserRoundCheck } from "lucide-react"
12
13import { DropdownMenuItem } from "@/components/ui/dropdown-menu"
14import { Spinner } from "@/components/ui/spinner"
15import { adminPlugin } from "@/lib/auth/admin-plugin"
16
17export type StopImpersonatingProps = {
18 className?: string
19}
20
21/**
22 * Restore the administrator's session when the current session is
23 * impersonating another user.
24 */
25export function StopImpersonating({ className }: StopImpersonatingProps) {
26 const { authClient } = useAuth()
27 const { localization } = useAuthPlugin(adminPlugin)
28 const { data: session } = useSession(authClient)
29 const stopImpersonating = useStopImpersonating(authClient as AdminAuthClient)
30
31 if (!isImpersonatingSession(session)) {
32 return null
33 }
34
35 return (
36 <DropdownMenuItem
37 className={className}
38 disabled={stopImpersonating.isPending}
39 onClick={() => stopImpersonating.mutate(undefined)}
40 >
41 {stopImpersonating.isPending ? (
42 <Spinner />
43 ) : (
44 <UserRoundCheck className="text-muted-foreground" />
45 )}
46
47 {localization.stopImpersonating}
48 </DropdownMenuItem>
49 )
50}

What it pulls in

npm packages

  • @better-auth-ui/react@latest
  • @better-auth-ui/core@latest
  • better-auth
  • lucide-react

Other registry items

  • dropdown-menu
  • spinner
  • https://better-auth-ui.com/r/radix-nova/user-button.json

Files it writes

  • src/lib/auth/auth-plugin.ts
  • src/lib/auth/admin-plugin.ts
  • src/components/auth/admin/stop-impersonating.tsx

Facts

Registry
better-auth-ui
Type
registry:component
Access
Free
Files written
3
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on better-auth-ui better-auth-ui.com better-auth-ui/better-auth-ui on GitHub Raw registry item This item as JSON

More from better-auth-ui

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Settingsaccount-settingsbetter-auth-uiComponentsFree2 deps
Active Sessionsactive-sessionsbetter-auth-uiComponentsFree5 deps · 2 files
Additional Fieldadditional-fieldbetter-auth-uiComponentsFree5 deps
Anonymousanonymousbetter-auth-uiComponentsFree4 deps · 3 files
API Keyapi-keybetter-auth-uiComponentsFree4 deps · 10 files
Authauthbetter-auth-uiComponentsFree2 deps
Auth Providerauth-providerbetter-auth-uiComponentsFree4 deps · 2 files
Auth Redirectauth-redirectbetter-auth-uiComponentsFree3 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