Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

API reference

The headless codeblock primitive is intentionally small. It only marks the major structural regions so you can build your own shell without coupling styles to wrapper internals.

Slot directives

Apply the primitives to the major regions of your authored shell. The directives only attach stable data-slot attributes.

Primitive structure

html
<section tngCodeBlock>
  <header tngCodeBlockHeader>...</header>
  <div tngCodeBlockBody>
    <ol tngCodeBlockGutter aria-hidden="true"></ol>
    <pre><code tngCodeBlockCode>...</code></pre>
  </div>
</section>

Slot contract

These are the only selectors the primitive adds for you. Everything else in the shell is owner-authored markup.

DirectiveHostSlot valueUse
tngCodeBlockRoot containercode-blockOverall shell background, border, radius, and layout.
tngCodeBlockHeaderHeader regioncode-block-headerTop bar for title, language badges, and owner-authored actions.
tngCodeBlockBodyBody wrappercode-block-bodyMain layout region for gutter and code content.
tngCodeBlockGutterLine-number listcode-block-gutterOptional gutter region when you render your own line numbers.
tngCodeBlockCode<code> elementcode-block-codeCode typography, token coloring, and line treatment surface.

Stable primitive selectors

css
[data-slot="code-block"]
[data-slot="code-block-header"]
[data-slot="code-block-body"]
[data-slot="code-block-gutter"]
[data-slot="code-block-code"]

Owner-managed behavior

  • Token markup and syntax-color classes are authored by you or your chosen renderer.
  • Copy buttons, keyboard shortcuts, and clipboard feedback are not part of the primitive.
  • Line-number content, highlighted ranges, and dimmed lines are all owner-managed presentation.
  • The primitive does not inject a highlighting adapter or render HTML for you.