BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/brainless/grok-slash-menu

Grok Slash Menu

brainless/grok-slash-menu
FreeComponent

Slash-command overlay above the real GrokPrompt composer — ❯ active row, type after / to filter.

Install it

npx shadcn@latest add https://brainless.swerdlow.dev/r/grok-slash-menu.json

Source

registry/brainless/grok/grok-slash-menu.tsxbrainless.swerdlow.dev/r/grok-slash-menu.json
1"use client";
2
3import * as React from "react";
4import { GrokPrompt } from "@/registry/brainless/grok/grok-prompt";
5import { cn } from "@/lib/utils";
6
7/**
8 * GrokSlashMenu — Grok CLI's slash-command palette.
9 *
10 * Overlay above the rounded composer: active row marked with `❯`, inactive
11 * rows indented. Type after `/` to filter; arrow keys move selection.
12 */
13export type GrokSlashCommand = { name: string; description: string };
14
15const DEFAULT: GrokSlashCommand[] = [
16 { name: "/quit", description: "Quit the application" },
17 { name: "/help", description: "Browse commands and keyboard shortcuts" },
18 { name: "/docs", description: "Open How-to Guides or online Build docs" },
19 { name: "/home", description: "Return to the welcome screen" },
20 { name: "/new", description: "Start a new session" },
21 { name: "/fork", description: "Branch the current session into a peer agent" },
22];
23
24const ACTIVE = "#e1e1e1";
25const INACTIVE = "#8b8b90";
26const RULE = "#505058";
27const NAME_COLS = 16;
28
29export function GrokSlashMenu({
30 commands = DEFAULT,
31 className,
32}: {
33 commands?: GrokSlashCommand[];
34 className?: string;
35}) {
36 const [value, setValue] = React.useState("/");
37 const [active, setActive] = React.useState(0);
38
39 const query = value.startsWith("/") ? value.slice(1) : value;
40 const list = commands.filter((c) =>
41 c.name.slice(1).toLowerCase().startsWith(query.toLowerCase()),
42 );
43 const clampedActive = list.length ? Math.min(active, list.length - 1) : 0;
44
45 function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
46 if (!list.length) return;
47 if (e.key === "ArrowDown") {
48 e.preventDefault();
49 setActive((a) => (a + 1) % list.length);
50 } else if (e.key === "ArrowUp") {
51 e.preventDefault();
52 setActive((a) => (a - 1 + list.length) % list.length);
53 }
54 }
55
56 return (
57 <div className={cn("font-mono text-[13px] leading-[1.55]", className)}>
58 <div
59 className="mb-2 border-y py-1.5"
60 style={{ borderColor: RULE }}
61 role="listbox"
62 aria-label="Slash commands"
63 aria-activedescendant={
64 list.length ? `grok-slash-${clampedActive}` : undefined
65 }
66 >
67 <ul className="space-y-0.5">
68 {list.map((c, i) => {
69 const activeRow = i === clampedActive;
70 return (
71 <li
72 key={c.name}
73 id={`grok-slash-${i}`}
74 role="option"
75 aria-selected={activeRow}
76// … truncated

What it pulls in

Other registry items

  • https://brainless.swerdlow.dev/r/grok-prompt.json

Files it writes

  • registry/brainless/grok/grok-slash-menu.tsx

Facts

Registry
brainless
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

brainless.swerdlow.dev theswerd/brainless on GitHub Raw registry item This item as JSON

More from brainless

All 40 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Claude Diffclaude-diffbrainlessComponentsFreeno deps
Claude Headerclaude-headerbrainlessComponentsFreeno deps
Claude Messageclaude-messagebrainlessComponentsFreeno deps
Claude Permissionclaude-permissionbrainlessComponentsFreeno deps
Claude Promptclaude-promptbrainlessComponentsFreeno deps
Claude Slash Menuclaude-slash-menubrainlessComponentsFreeno deps
Claude Thinkingclaude-thinkingbrainlessComponentsFreeno deps
Claude Todo Listclaude-todo-listbrainlessComponentsFreeno 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