Getting StartedInstallation and setup guides 6
FormInput and selection components 27
FlowWorkflow graph and execution surfaces 4
LayoutStructural layout components 9
NavigationMenu surfaces and hierarchical actions 7
OverlayModal and floating layer surfaces 3
FeedbackStatus, empty, progress, and loading placeholder patterns 6
UtilityGeneral-purpose interface utilities 7

Code Editor overview

Code Editor combines a native textarea with an aria-hidden highlighted overlay. Editing, selection, clipboard, undo, and IME behavior remain native while highlighting stays adapter-based.

Imports and provider

The component works without a highlighter and renders escaped plain text by default.

Component import

ts
import { TngCodeEditorComponent } from '@tailng-ui/components';

Optional highlighting provider

ts
provideTngCodeHighlighting({
  adapters: [shikiCodeHighlighterAdapter],
  defaultAdapter: 'shiki',
});

Editable source

Compare the same code-editor contract in Plain CSS and Tailwind CSS layouts. Each example includes HTML, CSS, and TypeScript source.

Code Editor (Plain CSS)

code-editor-plain-example.component.ts

ts
import { Component, signal } from '@angular/core';
import { TngCodeEditorComponent } from '@tailng-ui/components';

@Component({
  selector: 'app-code-editor-plain-example',
  imports: [TngCodeEditorComponent],
  templateUrl: './code-editor-plain-example.component.html',
  styleUrl: './code-editor-plain-example.component.css',
})
export class CodeEditorPlainExampleComponent {
  protected readonly source = signal(
    'def greet(name: str) -> str:\n    return f"Hello, {name}!"',
  );

  protected readonly codeTheme = signal<'github-dark' | 'github-light'>('github-light');
}
81 characters

Component boundaries

  • tng-textarea is for ordinary plain and multiline form text.
  • tng-code-editor is for editable source with optional highlighting.
  • tng-code-block is for read-only rendered source.

Accessibility baseline

  • The native textarea is the only interactive and accessibility surface.
  • The highlighted layer is always hidden from assistive technology.
  • Tab keeps its native focus-navigation behavior and is not trapped.
  • Readonly content remains focusable and selectable; disabled content does not.