GitHub

DaffContentComponentSchema

interface

import { DaffContentComponentSchema } from '@daffodil/content'

Represents an Angular component in the content schema. Used to dynamically render components with inputs and optional children.

interface DaffContentComponentSchema {
  type: "componentSchema"
  name: string
  inputs: { [key: string]: any; }
  children: DaffContentSchema[]
}

Properties

type
"componentSchema"

Discriminator for component schema nodes.

name
string

The component name to render. Must be registered in the component registry.

inputs
{ [key: string]: any; }

Key-value pairs of inputs to pass to the component.

children
DaffContentSchema[]

Optional child content to project into the component.

Examples

const buttonComponent: DaffContentComponentSchema = {
  type: 'componentSchema',
  name: 'DaffButtonComponent',
  inputs: {
    color: 'primary',
    size: 'lg'
  },
  children: [
    { type: 'textSchema', text: 'Click me' }
  ]
};

const buttonComponent: DaffContentComponentSchema = {
  type: 'componentSchema',
  name: 'DaffButtonComponent',
  inputs: {
    color: 'primary',
    size: 'lg'
  },
  children: [
    { type: 'textSchema', text: 'Click me' }
  ]
};