---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Inline code

A word or short phrase of code inside running text, such as a key or a path, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `InlineCode`.

## Try it

Type your own code into the line and make it long enough to wrap.

Nothing runs: it is words in a sentence.

## When to use

- A word or short phrase of code inside running text, such as a key or a path.

## When not to use

- For a block of code use CodeBlock.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Inline code on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-inline-code.json --yes
```

```text
Add the Goop Inline code to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { InlineCode } from '@/components/ui/goop/inline-code';

<p>
  Run <InlineCode>pnpm dev</InlineCode> to start.
</p>
```

- Fits: chat, record: body.
- width, padding, corner, background, text: add no class for these.

## API reference

### Options

- `asChild?: boolean = false` — Render the chip's look on the one child element instead of a `code`.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Code block](/themes/trail/components/code-block): A block of code or a command with a copy button.
- [Prose](/themes/trail/components/prose): A block of running text set for reading, one paragraph or several, for a description, an article or a help page.
- [Shortcut key](/themes/trail/components/shortcut-key): One keyboard key drawn as a small bordered cap inline in hint text, naming a chord with its neighbours.
- [Feature grid](/themes/trail/components/feature-grid): A grid of feature cells, each an icon, a title and a line, for a marketing or a pricing page that lists what a product does.
