

The NgStarter Angular Content Editor Renderer API documents the inputs, provider helpers, renderer definition shape, and dynamic renderer input contract for rendering saved Content Editor JSON blocks as HTML.
Import the renderer and provider helpers from @ngstarter-ui/components/content-editor. Use ngs-content-editor-renderer with blocks produced by ngs-content-editor-builder.
import {
ContentEditorRenderer,
provideContentEditorRenderer,
provideContentEditorRenderers,
ContentEditorBlockRendererDef,
ContentEditorBlockRendererInputSignals
} from '@ngstarter-ui/components/content-editor';<ngs-content-editor-renderer [content]="blocks"/>| Input | Type | Default |
|---|---|---|
contentSaved content editor blocks to render. Use this for persisted block JSON and preview data. | ReadonlyArray<ContentEditorBlock> | [] |
blocksAlternative input for the same block array. When provided, it takes precedence over content. | ReadonlyArray<ContentEditorBlock> | null | null |
| API | Type | Notes |
|---|---|---|
provideContentEditorRenderers(renderers)Registers multiple custom block renderer definitions through an environment provider. | EnvironmentProviders | Adds to default renderers |
provideContentEditorRenderer(renderer)Registers one custom block renderer definition. | EnvironmentProviders | Adds to default renderers |
CONTENT_EDITOR_BLOCK_RENDERERSMulti provider token used internally by the renderer to collect registered renderer definitions. | InjectionToken<ReadonlyArray<ReadonlyArray<ContentEditorBlockRendererDef>>> | [] |
| Property | Type | Required |
|---|---|---|
typeBlock type handled by this renderer, for example paragraph, heading, image, or a custom block type. | string | Required |
componentStandalone Angular component used for blocks with the matching type. | Type<unknown> | Required |
Custom renderer components receive these inputs from ngComponentOutletInputs. Use ContentEditorBlockRendererInputSignals when declaring renderer inputs with Angular input().
| Input | Type | Default |
|---|---|---|
blockOriginal block object passed to the renderer. | ContentEditorBlock | null | null |
idBlock id. | string | '' |
typeBlock type used to resolve the renderer. | string | '' |
contentBlock content payload. The shape depends on the block type. | TContent | undefined |
propsInline or block-level properties saved by the editor. | ContentEditorItemProperty[] | [] |
settingsBlock settings payload. The shape depends on the block type. | TSettings | {} |
indexZero-based block position in the rendered content array. | number | 0 |
Using this component in production?
NgStarter includes source code, admin dashboard templates, and commercial support.