Skip to contents

A catalog is the finite set of components the model is allowed to render. Each component compiles to one ellmer::tool(); the built-in lifecycle tools (update_component, remove_component, clear_canvas) are registered alongside it by genui_server().

Usage

genui_catalog(...)

Arguments

...

genui_component() objects, or lists of them (so component packs such as genui_components_bslib() can be passed directly).

Value

A genui_catalog object: a named list of components, keyed by component name.

Examples

note <- genui_component(
  name = "note_card",
  description = "A card showing a short note.",
  args = list(text = "The note text."),
  ui = function(id, args) htmltools::p(args$text)
)
catalog <- genui_catalog(note)
names(catalog)
#> [1] "note_card"