1) Plain Adapter (default)
example.component.ts
ts
import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: '<h1>Hello TailNG</h1>',
})
export class ExampleComponent {}No custom adapter selected.
Tailwind playground examples for adapter modes, copy behavior, line tools, wrapping, and HTML sanitization.
import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: '<h1>Hello TailNG</h1>',
})
export class ExampleComponent {}No custom adapter selected.
import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: '<h1>Hello TailNG</h1>',
})
export class ExampleComponent {}Custom adapter wraps keywords with inline classes.
import { signal } from '@angular/core';
const retries = signal(3);
export async function loadUser(): Promise<string> {
if (retries() > 0) {
return await Promise.resolve('ok');
}
return 'fallback';
}Token output + highlighted ranges + dimmed non-highlighted lines.
<main>
<section class="hero">
<h1>TailNG Code Block</h1>
<p>Adapter strategy for syntax highlighting.</p>
</section>
</main>Renders escaped plain text even when HTML-like markup exists.
pnpm nx run playground-tailwind:serve
pnpm nx run playground-plain-css:serve
pnpm tailng -- add code-block --cwd apps/tailng-ui/playground-registry
pnpm nx run-many -t build -p primitives,components
pnpm nx run-many -t vite:test -p primitives,components --skipNxCache
pnpm nx graphLarge snippet with wrapping and max-height scroll.
pnpm nx run playground-tailwind:serve
pnpm nx run playground-plain-css:serve
pnpm tailng -- add code-block --cwd apps/tailng-ui/playground-registryDisplayed code differs from copied payload.
const message = "sanitize";
safe text stays visibleScript tags and unsafe handlers are stripped by default.