DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
CodeView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA fragment of code inside a line of prose.Also called Inline code.StableSince 0.1.0TypographyImportimport'@fusion.dev/helix/code'import'@fusion.dev/helix-headless/code'Preview
GuidelinesWhen to use
A name from code inside a sentence, such as a property or a command.CodeThis page
Set translate="no" on the element to keep a page translator off the code.A translator that rewrites prose would also rewrite an identifier.
API referenceRoothelix-codeA fragment of code inside a line of prose.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The code.
PartDescriptioncodeThe <code> element.
CSS PropertyDescription--code-background-colorFill behind the fragment. Defaults to the foreground color at 6%, which looks the same on a light page and a dark one.--code-font-familyThe fragment's typeface. Defaults to the mono face.--code-foreground-colorColor of the fragment's text. Defaults to the foreground color mixed toward foreground-muted.--code-paddingSpace either side of the fragment. Defaults to half of space-2xs, so a bracket next to the fragment sits close to it.--code-radiusCorner radius of the wash. Defaults to radii-sm.--code-sizeThe fragment's size. Defaults to text-sm.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-headless-codeA fragment of code inside a line of prose.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The code.
PartDescriptioncodeThe <code> element.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Examples
NameDescriptionPreviewA fragment of code inside a line of prose.PreviewA fragment of code inside a line of prose.