You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check this section to learn more about form generation based on schema.
45
+
::
42
46
43
47
### Toolbar
44
48
@@ -61,7 +65,6 @@ One of this editor standout features is its ability to integrate and customize a
61
65
A developer can create any kind of visually complex components and editors will be able to use them and focus on the content. An editor can also play with the component properties, styles, and behaviour to fit its specific requirements as long as the developer made it customisable.
62
66
63
67
::steps{level="4"}
64
-
65
68
#### Create your component
66
69
67
70
You can create Vue components and integrate them into Markdown. They just need to be located in the `/components/content` folder to be available.

149
+
150
+
This editor is used whether you’re editing the [frontmatter]() of a `Markdown` file or a `JSON` / `YAML` file.
151
+
152
+
It eliminates the need to interact directly with complex file syntax. Instead, a form is automatically generated based on the provided user [collection schema](/docs/collections/define).
153
+
154
+
### **Defining your form with**`zod` Schema
155
+
156
+
::prose-note{to="/docs/collections/define"}
157
+
Learn more about schema collection definition in the dedicated section.
158
+
::
159
+
160
+
Once the `schema` property has been defined in your collection, this will automatically generate the corresponding form on Studio interface.
Primitive Zod types are automatically mapped to appropriate form inputs in:
203
+
204
+
-**String** → Text input
205
+
-**Date** → Date picker
206
+
-**Number** → Number input (counter)
207
+
-**Boolean** → Toggle switch
208
+
-**Enum** → Select dropdown
209
+
210
+
### Custom Inputs Mapping
211
+
212
+
Studio goes beyond primitive types. You can customise form fields using the `editor` method, which extends Zod types with metadata to empower editor interface.
213
+
214
+
This allows you to define custom inputs or hide fields.
215
+
216
+
#### Usage
217
+
218
+
```ts [content.config.ts]
219
+
mainScreen: z.string().editor({ input: 'media' })
220
+
```
221
+
222
+
#### Options
144
223
145
-

224
+
##### `input: 'media' | 'icon'`
146
225
147
-
This editor removes the need for users to interact directly with complex file syntax such as `YAML` or `JSON`.
226
+
You can set the editor input type. Currently `icon` and `media` are available.
148
227
149
-
Based on the user [collection and schema](/docs/collections/define) provided, a form is generated for both `YAML` and `JSON` files.
228
+
##### `hidden: Boolean`
229
+
230
+
This option can be set to avoid the display of a field in the Studio editor.
231
+
232
+
::prose-tip
233
+
Studio inputs are fully extensible. We can create as many input as we want based on our users needs.
234
+
::
150
235
151
236
::warning
152
237
Arrays are not yet handled but should be generated soon thanks to collections and user-defined schemas.
0 commit comments