Skip to content

Add slot (ReactNode prop) support #39

@effulgentsia

Description

@effulgentsia

Currently Component definitions can include props with a Zod schema and hasChildren for React's children prop. React also supports props named something other than children that, like children, are also of type ReactNode: what other frameworks call slots.

It would be great to be able to define such components in json-render. Perhaps adding a slots key to the Component definition, like:

{
  props: z.object({...}),  // Zod schema for props
  hasChildren?: boolean,    // Can it have children?
  slots?: [
    {name: 'slot1', description: 'Help AI understand when to use it'},
    {name: 'slot2', description: 'Help AI understand when to use it'},
  ],
  description?: string,     // Help AI understand when to use it
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions