The DlCodeInline inline component renders a semantic <code> snippet with the same look as Markdown backticks, but keeps the text on a single line. Use it when backtick code would wrap in prose.
The Why
DocLayer styles regular inline code to wrap inside paragraphs and lists, so long identifiers can break across lines. DlCodeInline applies a small, overridable UI layer so authors can opt into fully inline code without custom HTML or inline style attributes.
Features
- 📎 semantic
<code>output; inherits global theme - 📝 works with default slot or
codeprop - đź§© theme-friendly visual adjustments
Usage
Use :dl-code-inline (or the special shorthand :dl-code-i) as an inline component with the snippet in the default slot or the code prop.
Result: content.config.ts and content.config.ts
Formatting
- Markdown backticks are best for short inline mentions in running text.
DlFormatparses lightweight Markdown (bold, italic, nested backticks) into HTML, preserving the same styling and behavior as the original Markdown.DlCodeInlineis for a literal code string that must stay on one line and should not be reformatted. Try to not overuse it, as it still holds cost of the rendering.- Tables applies no-wrapped code by default, so
DlCodeInlineis not needed there.
Props
Here are the properties you can use with the DlCodeInline component. Each property should be set on an individual component instance; they do not affect the global configuration. More about defining properties in MDC components you can read here.
| name | type | default | description |
|---|---|---|---|
lazy | boolean | false | Whether to lazy load the component. |
code | string | undefined | Inline code snippet. Use when the default slot is impractical (tables, pipes, or other MDC edge cases). |
iui | Record<string, string> | undefined | Special property dedicated to inline components, can be used to add TW classes for certain component markup elements. |
Slots
| name | description |
|---|---|
default | Code snippet text. Ignored when the |
Styling
Styling from Markdown
Every DocLayer component can be styled directly within your Markdown file using dedicated slot/property configuration. This allows you to customize the appearance of the component's markup elements without modifying global styles. More about components styling you can read here.
Below you'll find the default set of Tailwind classes for the component's dedicated markup elements.
DlCodeInline relies on global code styles for colors, padding, and borders. The component UI only adds layout overrides. However if you need a local override, the :iui prop stands as a great outlet for that.
Accessibility
DlCodeInline renders a native <code> element with an accessible name. Keep snippets short and meaningful; use surrounding prose to explain longer references.
