Skip to content

Dependencies

Some widgets rely on third-party libraries that GolemUI deliberately doesn’t bundle — typically because the choice of library is opinionated. The Markdown widget needs a markdown parser; you might want to add others. These come in through formConfig.dependencies.

import { Dependencies } from '@golemui/gui-shared';
const formConfig: { dependencies?: Dependencies } = {
dependencies: {
markdown: {
parse: (md: string) => snarkdown(md),
},
},
};

Each widget that uses a dependency reads it from formConfig.dependencies at render time. If the widget needs a dependency you haven’t provided, it renders gracefully (e.g. the Markdown widget shows the editor but leaves the preview blank).

KeyUsed byShape
markdownMarkdown, Markdown Text{ parse: (md: string) => string }