From 512a04ec3a606af34e70a949cc0cb52dd8ae6d07 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 27 Jul 2021 10:40:57 +0200 Subject: [PATCH] chore: started some documentation on FieldExtensions Signed-off-by: blam --- .../writing-custom-field-extensions.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/features/software-templates/writing-custom-field-extensions.md diff --git a/docs/features/software-templates/writing-custom-field-extensions.md b/docs/features/software-templates/writing-custom-field-extensions.md new file mode 100644 index 0000000000..af703029e3 --- /dev/null +++ b/docs/features/software-templates/writing-custom-field-extensions.md @@ -0,0 +1,24 @@ +--- +id: writing-custom-field-extensions +title: Writing Custom Field Extensions +description: How to write your own field extensions +--- + +Collecting input from the user is a very large part of the scaffolding process +and Software Templates as a whole. Sometimes the built in components and fields +just aren't good enough, and sometimes you want to enrich the form that the +users sees with better inputs that fit better. + +This is where `Custom Field Extensions` come in. + +With them you can show your own `React` Components and use them to control the +state of the JSON schema, as well as provide your own validation functions to +validate the data too. + +## Creating a Field Extension + +Field extensions are a way to combine an ID, a `React` Component and a +`validation` function together in a modular way that you can then use to pass to +the `Scaffolder` frontend plugin in your own `App.tsx`. + +You can create your own Field Extension by us