Skip to content

Grok Prompt

The grok-like input box with ❯, the model and mode set into its bottom edge, and the GrokSlashMenu opening above it on /.

On this page

Examples

The shared grammar with the look fixed: the same as <CliPrompt preset="grok-like" />, so it reads as the grok-like look on its own or inside a session. Every part in all eight looks is on Agent CLI.

Installation

npx knowns-ui@latest add agent-cli-grok
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

value / defaultValue / onValueChange
string
Default""
The text, controlled or not. A still value such as "/he" shows the menu open.
onSubmit / onCommand
(text) => void / (name) => void
A line sent, a command taken. Without either the prompt is read only.
commands
{ name, args?, description? }[]
DefaultDEFAULT_COMMANDS
The slash menu's commands.
menu / menuRows
ComponentType / number
Defaultthis look's menu / 6
Another menu component, and how many rows it shows.
placeholder / readOnly / caret
string / boolean / boolean
The placeholder, read only, and a block caret after the text.
model / mode / modes / onModeChange
string / string / string[] / (mode) => void
Shown where the look prints them; Shift+Tab cycles modes.

When to use

When to use

  • An input a reader can try on a grok-like demo screen.

When not to use

  • The whole session with the prompt at its foot: use Grok Session.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Grok Prompt to my app and wire it to my own data.
  • I need an input a reader can try on a grok-like demo screen. Set that up with the Knowns UI Grok Prompt.
  • Which Grok Prompt props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "grok-prompt" }) and search_docs({ query: "grok prompt" }).

Need help?

Stuck on Grok Prompt, or found something off? We read every message.