Views
A view is a way to customise how a model is shown depending on the situation: creating a new instance, editing an existing one, or listing many at once. Each view holds its own set of constraints (display rules and validations) for the same model.
Why views exist
A single model is often used in very different contexts:
- On a creation form you may want only the minimum required fields visible.
- On the edit form you may want every field, with audit info read-only.
- In a table listing you only want a handful of columns — the most identifying ones.
Without views, you would have to pick one display configuration for all situations. Views let you tailor each context independently.
Built-in views
Yellow understands three built-in view tags. Each is consumed by the corresponding screen:
| View tag | Where it is used |
|---|---|
create |
The form shown when creating a new instance. |
update |
The form shown when editing an existing instance. |
table |
The columns shown when listing instances as a table. |
There is also the default view, which is what you edit when you open a model and no specific view tag is selected. It acts as a fallback for any situation in which a tagged view is not defined.
The default view fallback
If a screen asks for a tagged view (for example create) and that view is not configured for the model, Yellow automatically uses the default view instead. This means:
- You can leave the default view alone if it already produces the form you want.
- You only need to define a tagged view when it should differ from the default.
- A model with no views configured at all still works — Yellow uses the model's properties directly.
Custom views
Beyond the three built-in tags, you can create custom views with any name you choose. Custom views currently exist only as data — they are not automatically consumed by any built-in screen, but they are useful for:
- Documenting design intent on a model.
- Powering integrations or custom widgets that read constraints for a specific tag.
Editing views
Open a model from the Explorer and find the Views selector in the properties editor. You can:
- Switch between views to see and edit their constraints.
- Create a new view (one of the built-in types, or a custom name).
- Set per-view display constraints (order, visibility, read-only, layout
flex) and per-view validation constraints.
Changes are saved together with the model. See Constraints for the full list of validation rules you can configure per view.