terminusdb-documents-ui
to automatically generate customizable user interfaces for the document definitions in your TerminusDB schema. The utility takes frames as input and outputs forms in HTML format. A frame is the JSON structure of a JSON document, including the document's inherited properties and IRIs.npm
:FrameViewer
component into your code:FrameViewer
object of terminusdb-documents-ui
to configure, customize, and display your forms. FrameViewer
supports several parameters and functions.frame
uiFrame
type
mode
Create
, Edit
, or View
.formData
formData
in Edit
and View
modes to display data.hideSubmit
Submit
button to show view-only data.onSubmit
onChange
onSelect
Select
component.onTraverse
onClick
event with a document.FieldTemplate
terminusdb-documents-ui
is as follows:getSchemaFrame
to retrieve frame data from a TerminusDB database.FrameViewer
parameters and functions as required.FrameViewer
to display frame data in the specified form.frames
definition below consisting of one document Person
.Person
document. The callback function handleSubmit
displays any user-entered form data. Add functionality to handleSubmit
to suit your requirements. The uiFrames
parameter in the example adds customizations for your forms. See Customize the looks and feel of frames for details.FrameViewer
object supports three modes:Create
mode displays an empty frame as demonstrated in the previous example.Edit
mode displays populated and empty frames. This mode requires the formData
parameter.View
mode displays populated frames for view-only - the Submit button is automatically hidden. If the formData
parameter is omitted, an empty form is displayed.