Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Code & Kbd

Inline technical values and shortcut notation.

Preview

Live preview

Changes apply to this preview only.

Shortcuts

A compact keyboard reference.

Command paletteCmdK
Search/
SaveCtrlS
CloseEsc

Terminal

A block is the right surface for a command.

$ pnpm install
$ pnpm build:all
$ pnpm "playground dev"

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Inline

Code sits inside a paragraph without breaking its rhythm.

Open preview

Block

block wraps the code in a preformatted surface with horizontal scrolling.

Open preview

Keyboard

Kbd names a physical key; combine several keys in a row.

Open preview

Usage

Use Code for short fragments and Kbd for keys; neither registers a keyboard shortcut.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluCodeProps

Type source
PimoluCodeProps public API
NameTypeDefaultDescription
blockboolean | undefinedfalseRender a preformatted block instead of an inline fragment.
size"sm" | "md" | "lg" | undefined"sm"Relative font size. Defaults to "sm".
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
block

boolean | undefined

Default: false

Render a preformatted block instead of an inline fragment.

size

"sm" | "md" | "lg" | undefined

Default: "sm"

Relative font size. Defaults to "sm".

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluKbdProps

Type source
PimoluKbdProps public API
NameTypeDefaultDescription
size"sm" | "md" | "lg" | undefined"sm"Relative font size. Defaults to "sm".
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
size

"sm" | "md" | "lg" | undefined

Default: "sm"

Relative font size. Defaults to "sm".

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Explain shortcuts in readable text and avoid depending on punctuation alone.
Read the accessibility guide →