text.code
A block of code or terminal output shown to the reader
Read https://www.prongs.dev/docs/intents/text/code.md and tell me whether text.code fits what I am building.Text intents
Example
npx prongs add saas
<Text intent="text.code">npx prongs add saas</Text>Connections
Choosing between neighbours
If it is
Use
A block of code or terminal output shown to the reader
text.codeA sentence that mentions code; wrap the code in <code> inside text.body
text.bodyCode or a command
rather thantext.quotetext.code
For registry authors
Starter intents. These are the intents prongs add puts in your registry, shown in this site’s theme. Yours are your own registry.ts: rename, restyle and add to them, and see them with prongs add gallery.
What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.
How text.code resolves, and its definition
Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.
typography.monoMonospaced type
font-mono text-sm leading-6
tone.defaultMain text colour
text-foreground
surface.sunkenRecess cut into what it sits in
surface-inset rounded-lg
text.codeA block of code or terminal output shown to the reader
overflow-x-auto whitespace-pre p-4
font-mono text-sm leading-6 text-foreground surface-inset rounded-lg overflow-x-auto whitespace-pre p-4
'text.code': {
kind: 'semantic',
description: 'A block of code or terminal output shown to the reader',
refs: ['typography.mono', 'tone.default', 'surface.sunken'],
binding: { element: 'pre', classes: 'overflow-x-auto whitespace-pre p-4' },
notFor: [
{
context: 'a sentence that mentions code; wrap the code in <code> inside text.body',
instead: 'text.body',
},
],
},