Improve editor UI
You can use the render methods to customize how content is displayed in Val Studio and make the UI easier to navigate.
Multiline strings
Sometimes you want something that is not richtext but still multiple lines. Simple descriptions or even code blocks for example. Use render({ as: "textarea" }) to change the input to a multi-line textarea, making it easier to edit longer text content.
Code editor for strings
For strings that contain code, configuration, or structured data, you can use render({ as: "code", language: "..." }) to display a code editor with syntax highlighting. This provides a much better editing experience for technical content.
Supported languages
The code editor supports syntax highlighting for many popular languages including:
JavaScript and TypeScript
JSON, YAML, TOML
HTML, CSS, SCSS
Python, Java, Go, Rust
SQL, GraphQL
Markdown, Shell/Bash
List view
When working with records of objects, you can use render({ as: "list" }) to display items as a nice looking list with thumbnails. This makes it much easier for editors to navigate and edit collections of content.
Basic list view
The select() function determines what information is displayed in the list view. You can show a title, subtitle, and image for each item.
List view benefits
Using list view makes it significantly easier for editors to browse and manage collections. Instead of navigating through a tree of items, editors see a visual list with thumbnails and key information at a glance.
Customizing list display
The select() function receives the current value in the val parameter. You can return any combination of title, subtitle, and image. Both subtitle and image are optional.