Skip to main content
Copy for LLM

Code

Inline code component for short snippets that sit within text flow — variable names, paths, commands, identifiers. Renders a <code> element with a tinted background, subtle border, and the design-system monospace font.

For multi-line snippets (commands, route definitions, file contents) use <x-wirekit::code-block> instead.

Live Sandbox

This is a hydrated playground for the component. Toggle "Live preview" on the block below to swap the static HTML render for a real Livewire instance — every prop in the component's sandbox schema becomes an editable form field inside the iframe, so you can try different prop combinations live without writing any local code.

Sandbox
$wirekit

Basic Usage

Inline code in text flow

Run composer require pushery/wirekit to install.

In Headings

Inline code sizes itself relative to the surrounding text: its font size is 0.875em, so inside a heading it scales with the heading, a step smaller than the words around it.

Inline code in a heading

Configure config/wirekit.php

Long Names in a Row

A name somebody chose, such as a channel, a branch or a file, may have no space or hyphen to wrap at. Inline code breaks such a name inside its own box rather than letting it run out, but a flex row still cannot shrink it below the name's full width, so the row runs out of its box instead. Set break="anywhere" and the row can shrink the name, which then wraps only where the line would otherwise overflow.

A channel name in a narrow row
Slack #releases_and_incident_announcements_for_every_region

The prop takes the same three values as on text and heading, with the same meaning: anywhere breaks only where a line would overflow, all between any two characters, and normal restores the browser's default rules. Use the prop rather than a class of your own: a class beside the component's default rule competes with it, and the order of the stylesheet decides which one wins.

Operators at the End of a Line

Inline code stands in running text, where a line may break after a hyphen. An operator such as ->, -= or --force is held together, so it never ends one line and starts the next. A hyphen inside a name, such as Retry-After, stays a place where the name may break, and the code a reader copies is unchanged. Inline code that a page renders from Markdown itself, outside this component and outside a prose body, gets the same from WireKit::proseCodeJoins().

An operator in a sentence

Before the header renders, read the name of the account with $account->name and show it beside the avatar, or wait as long as Retry-After says.

Props

Prop Type Default Description
break string|null null Where an unbroken name may wrap: anywhere only where the line would overflow, which lets a flex row shrink it, all between any two characters, address at the seams of an email address, a host or a URL first, normal the browser default. Unset, a name breaks inside its box without changing the row's layout. The same values as on text and heading
scope string|null null Scoped personalization name

Keyboard Interaction

This component is purely presentational and does not respond to keyboard input.

Design Tokens

Token Used for
--font-wk-mono Monospace font family
--color-wk-code-bg Background color, the muted background unless you set it
--color-wk-code Foreground color, the text color unless you set it
--color-wk-border-subtle Border color
--radius-wk-sm Border radius

See Also

Updated in WireKit v2.74.0 (2026-11-24)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store