Edit and Create Annotations
2/5/26Less than 1 minute
Edit and Create Annotations
By default, edit and create annotations are disabled. You can enable them by on the AnotationAdapter when creating the AnnotatedText component.
import { createAnnotatedText } from "@ghentcdh/annotated-text";
createAnnotatedText(id,
{
annotation: { edit: true, create: true },
})Or you can enable/disable them on the fly using setConfig.
import { createAnnotatedText } from "@ghentcdh/annotated-text";
// Create the annotated text component with the ID
const textAnnotation = createAnnotatedText(id);
// Enable/or disable them on the fly using setConfig
textAnnotation.annotationAdapter.setConfig('edit', true);
textAnnotation.annotationAdapter.setConfig('create', true);
// Or directly set the properties
textAnnotation.annotationAdapter.edit = true;
textAnnotation.annotationAdapter.create = true;