Grok Prompt
brainless/grok-promptFreeComponent
Grok's rounded CSS-border composer with a real text input and model · mode legend (normal / plan / auto / always-approve / plan approval).
Install it
npx shadcn@latest add https://brainless.swerdlow.dev/r/grok-prompt.jsonSource
1"use client";23import * as React from "react";4import { cn } from "@/lib/utils";56/**7 * GrokPrompt — Grok CLI's rounded composer box.8 *9 * CSS border (no box-drawing glyphs) around a real text input. The model · mode10 * legend sits on the bottom edge like a fieldset legend. Plan mode tints the ❯11 * yellow; legend mode text stays muted gray.12 */13export type GrokMode =14 | "normal"15 | "plan"16 | "auto"17 | "always-approve"18 | "plan-approval";1920const BORDER = "#505058";21const FG = "#e1e1e1";22const MUTED = "#6c6c6c";23const SEP = "#585858";24const PLAN = "#ffff00"; // 38;5;11 — plan caret only25const SURFACE = "#1a1a1a"; // matches --term-bg so the legend punches the border2627const MODE_LABEL: Record<GrokMode, string | null> = {28 normal: null,29 plan: "plan",30 auto: "auto",31 "always-approve": "always-approve",32 "plan-approval": "plan approval",33};3435export function GrokPrompt({36 value,37 defaultValue = "",38 onChange,39 onKeyDown,40 placeholder = "",41 mode = "always-approve",42 model = "Grok 4.5 (xhigh)",43 showShortcuts = true,44 busy = false,45 className,46 inputClassName,47}: {48 value?: string;49 defaultValue?: string;50 onChange?: React.ChangeEventHandler<HTMLInputElement>;51 onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;52 placeholder?: string;53 mode?: GrokMode;54 model?: string;55 showShortcuts?: boolean;56 /** Mid-turn: insert Ctrl+c:cancel into the shortcut hint row. */57 busy?: boolean;58 className?: string;59 inputClassName?: string;60}) {61 const controlled = value !== undefined;62 const modeLabel = MODE_LABEL[mode];63 const caretColor = mode === "plan" || mode === "plan-approval" ? PLAN : FG;64 const legend = modeLabel ? `${model} · ${modeLabel}` : model;6566 return (67 <div className={cn("min-w-0 font-mono text-[13px] leading-[1.5]", className)}>68 <div69 className="relative min-w-0 rounded-sm border px-2 py-1.5"70 style={{ borderColor: BORDER, background: SURFACE }}71 >72 <div className="flex min-w-0 items-center gap-0">73 <span74 aria-hidden75 className="shrink-0"76 style={{ color: caretColor }}77 >78 ❯79 </span>80 <input81 type="text"82 aria-label="Prompt"83 placeholder={placeholder}84 onKeyDown={onKeyDown}85 {...(controlled86 ? { value, onChange }87 : { defaultValue, onChange })}88 className={cn(89// … truncated
Files it writes
More from brainless
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Claude Diffclaude-diff | brainless | Components | Free | no deps | |
| Claude Headerclaude-header | brainless | Components | Free | no deps | |
| Claude Messageclaude-message | brainless | Components | Free | no deps | |
| Claude Permissionclaude-permission | brainless | Components | Free | no deps | |
| Claude Promptclaude-prompt | brainless | Components | Free | no deps | |
| Claude Slash Menuclaude-slash-menu | brainless | Components | Free | no deps | |
| Claude Thinkingclaude-thinking | brainless | Components | Free | no deps | |
| Claude Todo Listclaude-todo-list | brainless | Components | Free | no deps |
