Editor metadata and selections
Editor metadata describes entity types, action fields, presentation hints and available choices to the admin and other clients.
For the team workflow, see An entity.
Vox describes every entity type and action with metadata from code. It's presentation metadata rather than a dependency on the built-in Admin UI, so another client can render the same labels, descriptions, nested fields, validation and choices. It gives generic, purpose-built and AI-generated interfaces a discoverable view of the same domain contract instead of requiring each application to encode its own interpretation.
What code says is the default that everyone gets. Each person can then adjust the Admin UI for themselves, eg add a column to the product list or move a field to another section, without changing anyone else's screen; see personal changes. Set good defaults in code: every environment then looks the same, and a new user gets a sensible admin UI everywhere without any setup.
Labels and editor hints
Use the standard data-annotation attributes where they already describe presentation:
public class ProductEditorial
{
[Display(
Name = "Editorial description",
Description = "Shown on the product detail page.",
Prompt = "Write a short description",
Order = 10)]
public virtual VoxRichText Description { get; set; } = VoxRichText.Empty;
}
Display is supported on entity types, custom action classes, action fields, entity properties and nested object
properties. Its name, description, prompt and order are returned by /api/entity-types, and on a top-level entity
property, its group is the field's section, see sections and tabs. VoxRichText has the
field type RichText, which selects the rich text editor automatically. The legacy markdown and html UI hints remain string editors, while new rich
text properties should use the first-class type. UIHint also recognizes multiline, code, json and color; an
unknown hint safely falls back to the normal type editor. Standard DataType values select email, URL, telephone and password inputs. VoxConfirmation
makes the Admin UI ask before it runs an action. A field's unit is a fact about its values rather than a hint, see
units.
The schema is recursive. Nested objects and lists of objects are rendered as structured forms rather than generic JSON
text areas. JSON remains available explicitly through [UIHint("json")] and as a fallback for unsupported shapes.
A VoxTimeline<T> property, see values that change over time, has the
type Timeline, with its values described by item. It's calculated or imported, so the Admin UI shows it read only: its
periods with their start and end in local time, a time bar with a marker for now and the current period highlighted. A
list column shows its current value with a hint that a change is scheduled.
A VoxFieldValues property, see Field sets, has the type FieldValues. Its fieldSet is the name of
its class, fieldCount is the number of its fields, and fieldSets lists its templates with their ids and labels. Its
fields aren't among its children, since a set can have thousands: the Admin UI loads them on demand from
POST /vox/api/entity-types/{entityType}/properties/{property}/fields, which searches the set or returns a template's
fields with the JSON names of its required ones. Because the values are sparse, the Admin UI shows only the fields that
are set, lets an editor add another field of the set or remove one, and leaves a field without a value out of what it
saves. The editor selects a template in the values' fieldSet, and the Admin UI then offers only its fields and always
shows its required ones.
How much room a field gets
The Admin UI lays out the fields of an entity in a grid of 1, 2, 4 or 6 columns, depending on how wide the section is. The room a field gets comes from its type, not from a width setting:
| Size | Width | Used for |
|---|---|---|
| S | 1 column | Numbers, dates and times, yes/no, an enum, a single asset, and short text |
| M | 2 columns | Text on one line, a reference to an entity, a selection, and a list edited in one column: choices, references to entities, or simple values. This is the default for text |
| Prose | A row of its own, with the editor in its left half, and its channel switch, fallback and description in the right half | Rich text, and text over several lines ([DataType(DataType.MultilineText)] or the multiline hint) |
| Full | A row of its own | Galleries of assets, lists of objects, dictionaries, objects, field values, and fields with an editor of their own |
A varying field gets the size of its values, so a description per language is rich text and is Prose. A field with a
hint or a plugin's editor for its path gets a row of its own, since the Admin UI can't know how much room that editor
needs. The exceptions are the built-in multiline and textarea editors, which are Prose, and selection, which is
M. An object or field values that can't be edited is laid out in the same grid, with each field's label above its value. Every field's label row is one line high, so the inputs of a row line up: a label that doesn't fit ends in "…", and a field's description and notes go below its input, except for a field with a row of its own, whose description stays by its label. A field that grows in height as it gets values, a list of entity cards or a one-column table, always starts its row, with only fields that don't grow beside it, or else a row of its own at the same width. Fields that fit move up into a gap before a field that needs a row of its own, so the order on screen can differ
from the model's order, and Tab follows the order on screen.
Text is M unless the model says that its values are short, like a product number or a code. That is a fact about the
values, not presentation, so nobody can change it at runtime. A text field is short when it has [VoxShortText], or
when its maximum length from [MaxLength] or [StringLength] is 40 or less:
public class Product
{
// Short, but an import may still bring a longer one, so it has no hard limit
[VoxShortText]
public virtual string ProductNumber { get; set; } = "";
// Short because it can never be longer than three characters
[StringLength(3, MinimumLength = 3)]
public virtual string MarketCode { get; set; } = "";
}
The field model returns the fact as isShortText. [VoxShortText] only applies to text, that is a string or a
varying property of strings; on anything else the application fails to start with an error naming the property. A
field of a field set takes [VoxShortText] like a property.
Units
[VoxUnit] says what unit the values of a property are in, so the property can be called Weight rather than
WeightKg:
public class ProductVariant
{
[Display(Name = "Weight"), VoxUnit("kg")]
public virtual decimal? Weight { get; set; }
// On a list or dictionary, the unit applies to each value
[VoxUnit("cm")]
public virtual List<decimal> Measurements { get; set; } = [];
}
Like a short text, a unit is a fact about the values, so it's the same for everyone and nobody can change it at
runtime: a weight of 2.5 means 2.5 kg whoever looks at it. The field model returns it as unit, and the Admin UI shows
it next to the editor and the value. The MCP server adds it to
the description of the field's schema, eg "description": "Weight. Unit: kg.", so an agent knows what a number means
and writes 2.5 rather than 2500 for a weight it found in grams. A unit is a label: Vox doesn't convert between units or
check that a value is in the right one. It's usually on a number, but any field can have one, eg a size range stored
as "42-44" with the unit "EU". A field of a field set takes [VoxUnit]
like a property, and an attribute has a unit of its own.
Lists, cards, galleries and trees
Entity-level metadata describes how a generic UI presents a collection without coupling the entity to one frontend:
[VoxIcon("megaphone")]
[VoxView(VoxViews.Cards)]
[VoxTitle(nameof(Name))]
public class Campaign : IVoxEntity, IVoxEntityLayout<Campaign>
{
public static void ConfigureLayout(VoxEntityLayoutBuilder<Campaign> layout)
{
layout.Subtitle(campaign => campaign.Status);
layout.Image(campaign => campaign.Banner);
}
// ...
}
Built-in views are table, tree, cards and gallery. An application can register another view name without changing the metadata contract.
[VoxTitle] names the field that titles an entity, by its JSON path, and nameof works for nested paths too, eg
[VoxTitle($"{nameof(Content)}.{nameof(ProductContent.Name)}")]. The title is more than a screen choice: it's how the
API names an entity in references, eg {"id": "fi", "title": "Finland"}, in context lists and in the effects of drafts
and releases. So it's meaning, the same for everyone, and can't be changed at runtime. The subtitle, a second line under
the title on cards, in trees and in the reference dialog, and the image, a reference to an asset that pictures the
entity on rows, cards, tree nodes and in the gallery, are screen choices, so they're in the entity type's
layout, and each person can change them for themselves.
Without a title, Vox picks a field that looks like one, eg name, title or label, else a top-level field whose
name ends with Name or Title. An entity type with neither and with generated ids is titled by its single references,
the required ones if it has any, eg "Trail Runner 2 · Finland" for a price of a variant in a market. A title field that
is a reference titles an entity by the referenced entity's title. The entity types of the API carry the result as
presentation.titleField and presentation.titleReferences, which the admin UI and the TypeScript client use, so
every client titles entities the same way.
The image can be any reference to an asset, owned or calculated, and the first one of a list is used. A product whose images are on its variants can calculate the image that lists it, and point the layout at that:
[VoxTitle($"{nameof(Content)}.{nameof(ProductContent.Name)}")]
public abstract class ProductBase : IVoxAuthoredEntity, IVoxEntityLayout<ProductBase>
{
public static void ConfigureLayout(VoxEntityLayoutBuilder<ProductBase> layout) =>
layout.Image(product => product.ListingImage);
// The first image of the product, otherwise of the first variant that can be bought, otherwise of any variant
[VoxCalculated(typeof(ProductListingImageCalculation))]
[VoxRelation(InverseName = "listedProducts")]
public virtual VoxReference<Image>? ListingImage { get; set; }
}
A list shows the previous image until the recalculation has run, eg right after a variant goes out of stock. See Calculations. An asset entity type without an image pictures itself.
Trees
An entity type is a tree when it has [VoxTree(Parent = ...)], or when it has exactly one single reference to its own
entity type, eg Category.Parent. [VoxTree(Order = ...)] names the field that orders siblings, which are otherwise
ordered by their title. The tree is meaning too: the parent relation means "is inside", whichever screen shows it, and
the API's descendant filter follows it, eg GET api/products?relation.categories[descendants]=outdoor returns the products in
the category outdoor and every category below it. So the tree comes from code only and can't be changed at runtime,
and the entity types of the API serve it as presentation.treeParent and presentation.treeOrder, inferred or not, so
the admin UI's tree and the descendant filter always agree. Vox checks [VoxTree] when the application starts: a
Parent that isn't a single reference to the entity type itself, or an Order that isn't one of its fields, stops it
with an error that says so.
Layouts
The columns of a table, the subtitle and image, the relations shown with an entity and the tabs of its detail page are
screen choices rather than facts about the entity. An entity type declares them in its layout, next to its attributes
and properties, by implementing IVoxEntityLayout<TSelf> with a static ConfigureLayout method that picks them by
their properties:
public class Category : IVoxAuthoredEntity, IVoxRoutable, IVoxEntityLayout<Category>
{
public static void ConfigureLayout(VoxEntityLayoutBuilder<Category> layout)
{
layout.Column(category => category.Name);
layout.Column(category => category.Statistics.ProductCount);
layout.Relation(category => category.Parent);
layout.Relation(category => category.Children);
layout.InverseRelation((ProductBase product) => product.Merchandising.Categories).AsTab();
layout.Subtitle(category => category.Slug);
layout.Image(category => category.HeroImage);
}
// Built-in and other properties omitted.
}
The method is static because Vox creates entities from stored data and has no instance to call it on.
Columnadds a column to the list, a field of the entity type or of one of its objects.SubtitleandImagepick the second line under the title and the asset that pictures the entity, see lists, cards, galleries and trees.Relationpicks a relation of the entity type, of one of its objects or an inverse navigation, andRelation((BundleVariant variant) => variant.Components)one of a kind of it.InverseRelationpicks the entities of another type that refer to this one, by the property of their relation.AsTabgives a relation a tab of its own: the list of the related entity type, with its filters, views and selection, of only the related entities. Only a relation to a single entity type can be a tab.Tabputs sections of the entity's fields on a tab of their own, see sections and tabs.
The entity type declares the layout, not its kinds: a kind's class inherits the interface from the entity type, and a
kind that declares a layout of its own stops the application, since Relation<TKind> already covers a relation of one
kind. The interface and method can be in another file of a partial class, which is how a generated entity type gets a
layout that regenerating doesn't overwrite. Vox reads every layout when the application starts, so a column, subtitle,
image, relation or section that doesn't exist stops it with an error that says so.
A layout is the default that everyone gets. Each person can change its columns, subtitle, image, relations and tabs for themselves in the Admin UI, see personal changes. These are presentation defaults, not domain rules: another client may choose a different layout while using the same actions, permissions and data.
Sections and tabs
The Details tab of an entity is one form with one Save button, divided into sections:
- General holds the top-level fields that aren't objects.
- Each top-level object is a section of its own, eg
Product.Dimensionsis a Dimensions section, labelled and ordered by the[Display]of its property or class. - Named sections hold the top-level fields whose
[Display(GroupName = ...)]names them, without changing how the entity is stored. An object with aGroupNameis shown inside that section as a band rather than as a section of its own, andGroupName = "General"puts a field in General.
public class Item : IVoxEntity, IVoxEntityLayout<Item>
{
public static void ConfigureLayout(VoxEntityLayoutBuilder<Item> layout)
{
layout.Tab("Compliance", "Compliance", "Warranty");
layout.Tab("Specifications", item => item.Specifications);
}
[Display(Name = "Eprel number", GroupName = "Compliance")]
public virtual string? EprelNumber { get; set; }
[Display(Name = "Warranty period (years)", GroupName = "Warranty")]
public virtual int? WarrantyYears { get; set; }
public virtual VoxAttributeValues Specifications { get; set; } = new();
// Built-in and other properties omitted.
}
General comes first, then the named sections in the order of their first field among the class's properties, then the
sections of objects. Only top-level properties have a section: a field inside an object goes where its object goes, and
the fields of a field set or attribute values go where their property goes. So a GroupName on a property inside an
object, on a field of a field set or on a command's property stops the application when it starts, and so does a
GroupName equal to the name of a top-level object, eg "Dimensions" next to Product.Dimensions, rather than quietly
merging the two. On the entity type itself, [Display(GroupName = ...)] is its section of the
navigation, which is something else.
layout.Tab(name, sections) puts named sections, or "General", on a tab of their own, and layout.Tab(name, objects)
puts the sections of objects there, by their properties. The page of the Item above has these tabs:
- Details, with General and every other section that isn't on a tab. When every section is on a tab, there's no Details tab, and the first tab opens first.
- Compliance, with the Compliance and Warranty sections.
- Specifications, with the section of the
Specificationsattribute values. - Then the relation tabs and the tabs that plugins add, eg Relations, Variations, History and Effects.
The field tabs are parts of the one Details form: someone who edits a field on Details, switches to Compliance and
edits another, then saves, saves both. Unsaved edits stay while any tab of the entity is open, and are dropped when
leaving the entity's page, as before. A field tab shows a marker when its fields have unsaved changes, changes in the
draft, conflicts or validation errors, so an error on a field that isn't on screen can be found. The tab is in the URL,
eg ?tab=Compliance, like the other tabs, so the application refuses to start when a field tab is called Details, or
has the name of one of the entity type's relation tabs, or puts a section on two tabs. A plugin tab with the same id as
a field tab can't be opened on that entity type, and the Admin UI says so in the browser console. A tab's label is its
name, and tabs are in the order of their first section. The create screen and action dialogs aren't divided into
sections or tabs, and a section or tab without fields to show, eg because they all belong to another kind, isn't shown.
A section's label, description and order can be set with [Display] on an object's property or class. Each person can
move a field to another section, and a section to another tab, for themselves, see
personal changes.
The Admin UI also groups entity types through standard display metadata and uses VoxIcon in navigation, see
Navigation. Together, these annotations make a new entity usable in generic administration without a
hand-written list and detail screen.
Navigation
Vox is a data layer for PIM, CMS, OMS, WMS and other systems, so it doesn't know what a block, a CVL or a return reason is. Every entity type still gets a sensible place in the sidebar of an admin UI, from what Vox does know of it, and an optional area of the navigation. Each entity type has one placement:
- Link: a link of its own in a section of the sidebar, which is what an entity type gets unless something else applies.
- More: a link behind its section's "N more" toggle, collapsed until it's opened, eg for types that are used now and then. The toggle opens by itself on the page of one of them.
- Hidden: no link at all, eg for an internal type that's edited through another one. It's still reached by its route, through references and by search.
A placement is presentation only. Routes, direct links, reference pickers, search, releases, history, the API, MCP exposure and permissions don't change with it.
Where an entity type goes
The first of these that applies decides it:
- An explicit placement: the person's own change, see personal changes, else
[VoxNavigation(Placement = ...)]on the entity type, which is the only way to place it in code. - The entity type derives from an abstract class or implements an interface marked
[VoxNavigation]: it has no link of its own, since it's on that base's link (see below). - A context type, eg Market, Language or Channel, is a link in the Contexts section, also when it's a choice set.
- A singleton is a link in the Settings section.
- An external entity type is a link in the Imported section.
- Anything else, choice sets included, is a link in its group,
[Display(GroupName = "Catalog")], or the Content section.
The inferred sections go after the sections of code by default, in the order Content (500), Contexts (800), Imported
(850) and Settings (900): a section goes where the lowest order of its links does, and a link without an Order gets
its inferred section's. /api/entity-types returns each entity type's resolved placement, section, navigationOrder
and, when it's on the link of a base, navigationLink, with where the placement and section come from (Code,
Override, the person's own change, or Inferred), so an admin UI only renders what it's given.
[VoxNavigation(Placement = VoxNavigationPlacement.More)]
public class Supplier : IVoxEntity { /* ... */ }
[VoxNavigation(Placement = VoxNavigationPlacement.Hidden)]
public class ResourceFieldSetValue : IVoxEntity { /* ... */ }
[VoxEntityFamily] plays no part in it: a family is one entity type, so it's one link.
Shared links
[VoxNavigation] on an abstract class or an interface that isn't an entity type itself makes it a base: one link
for every entity type that derives from it or implements it, eg the blocks of a CMS or the CVLs of a PIM. Since
[Display], [VoxIcon] and [VoxRouteName] can't be put on an interface, the link is presented by the attribute:
[VoxNavigation(Name = "Blocks", Description = "Blocks are placed on pages, and one block can be on several.",
Group = "Content", Order = 20, Icon = "rectangle-stack", RouteName = "blocks")]
public interface IContentBlock : IVoxAuthoredEntity { /* ... */ }
Without a name, the label is the type's name without the leading "I" of an interface, and without a route name the
route is derived from that like an entity type's, eg contentblocks. Without a group, the link is in the Content
section. On an entity type, [VoxNavigation] is always its placement, so it requires Placement and can't have the link
properties, and on a base it can't have a placement. An entity type under a base that's given a placement of its own,
in code or by a person for themselves, is taken off the base's link.
The link shows only the entity types the user may read, and is left out if there are none. Its page has one of two designs, decided by the entity types under it:
- Stored entity types are tiles above one list of all their entities. Each entity type is a tile with its icon,
label and description, and a family is a tile per kind. A tile has a count only when its entity type is expected to be
small or medium, see
[VoxExpectedCount], so opening the page never counts a table of millions. The list of all of them is newest first, fromGET /api/navigation/{routeName}/entities, without search or filters; picking a tile shows that entity type's own list, eg/blocks?type=content-blocks&kind=hero, and creates that type or kind. - Light entity types are a browser of lists beside the values of the picked one, eg the CVLs of a PIM. The lists are
searched by label and name, and grouped by the entity types whose fields use them (their relations, and the fields of
their field sets), alphabetically or by their most recent change, from
GET /api/navigation/{routeName}/lists. The values are edited in place and take effect at once, since light entity types have no drafts. A field that varies by context, eg a name per language, is one column shown in one language at a time, the selected one by default, with the value it falls back to where it has none. A row has the key, the title and as many fields that can be edited in a row (texts, numbers, switches) as the width of the table has room for; a value with more, or with fields that need more room, eg dates, references and objects, has a button for a dialog with every field, which also has every language of its varying texts, since there can be dozens of them. A value is added in a row of its own when every field of its create action is in the row, and in a dialog otherwise.
The entity types under a base must be either all light or all stored. Vox checks bases when the application starts, so
one that isn't an abstract class or an interface, has no entity type under it, has a route of an entity type or another
base, or mixes light and stored entity types stops it, and so does an entity type under two bases without a placement
of its own. GET /api/navigation lists the links with the entity types the user may read.
A user can pin any entity type they may read, also one on a shared link, under More or Hidden, to a Pinned section at the top of their own sidebar. Pins are kept in the user's preferences and change nothing for others.
Areas
A large application can divide its navigation into areas, eg PIM, CMS and Commerce, and an add-on can bring an area of its own, eg Promotions. The admin UI shows the areas in its top bar, and its sidebar shows the sections of the current area only. An area is an optional classification in code, next to the section:
[VoxArea("CMS")]
[Display(Name = "Pages", GroupName = "Content", Order = 10)]
public class ContentPage : IVoxAuthoredEntity { /* ... */ }
[VoxArea("CMS")]
[VoxNavigation(Name = "Blocks", Group = "Content", Order = 20, Icon = "rectangle-stack", RouteName = "blocks")]
public interface IContentBlock : IVoxAuthoredEntity { /* ... */ }
-
[VoxArea]goes on an entity type, including the root of an entity family, which covers its kinds, or on a base marked[VoxNavigation], for its link and the entity types on it. An entity type on a base's link is in the link's area, and one under a base but placed on its own keeps the base's area unless it has one of its own. Startup rejects[VoxArea]anywhere else, eg on a kind or on a marker interface that entity types implement, and an entity type on a link with an area other than the link's. -
Entity types and pages without an area are shared: they're in every area. Markets, a settings singleton that every team uses, or the Releases page show in the sidebar of each area. A shared item goes into the area's section with the same title, eg the shared Settings join Commerce's Settings, and otherwise forms a section of its own in the area. Give shared entity types a section that no area uses, eg
[Display(GroupName = "Shared")], to keep them apart. An application that never uses areas has one unnamed area with every entity type, and the top bar shows none. -
An area is there for a user when they may see something of its own, after permissions and their perspective: shared items alone don't make an area. A Hidden entity type has no link, so it's neither shared nor an area's own.
-
The order of the areas is the application's,
VoxOptions.AreaOrder, and the first area a user sees is where they land when they open the admin UI:builder.AddVox(options => options.AreaOrder.AddRange(["Catalog", "Commerce", "Content"]));Areas that aren't listed, eg an add-on's, follow by name, and without a list all areas are ordered by name. Startup rejects an empty name and a name listed twice; a listed name that nothing uses isn't an error, since plugin pages may use it.
GET /api/appreturns the order asareas, before sign-in too, like the application's name. -
There's no list of areas to declare: the areas are the names in use, so a name spelled two ways is two areas. A section is per area: Settings in two areas are two sections.
-
An area is presentation only, like a placement, and set in code only; a person's own changes can't move an entity type to another area. Entities in different areas still refer to each other, and opening one moves the admin UI to its area.
/api/entity-typesreturns each entity type'sareaandGET /api/navigationeach link's.
In the admin UI, an area's item in the top bar opens its home, eg /areas/catalog, when it has one, else the first page
of its menu; see Extend the admin UI. A page whose entity type is shared keeps
the area the user is in, which the URL carries, eg /markets?area=content, so a copied link opens in the same area.
An area whose own items are a single page, eg an add-on's Promotions with only Campaigns, has no home, no sidebar and
no shared items: its item opens the page at once, at the whole width. An area with a home of its own, or the only area
a user sees, is never such an area. A plugin's navigation item takes area like an entity type.
My navigation
Everyone signed in can arrange their own sidebar on the My navigation screen, in the account menu. It lists the
entity types with what Vox knows of them, their placement, section and where those come from, and the shared links with
their label, description, section, order and icon, beside a preview of the sidebar with the person's changes. A
placement change is the placement property of an entity type (Link, More or Hidden; reset it to use code or
inference again), and a shared link is the NavigationLink target, by the full name of the base's type. Like every
personal change, it changes only that person's sidebar, and Copy as code writes their changes
as [VoxNavigation] attributes, to make them everyone's default.
Choice sets
Apply VoxChoiceSetAttribute to an entity type whose entities form a bounded set of choices. As with other .NET
attributes, it is normally written in its shortened form, [VoxChoiceSet]. The entity ID is the stable value stored
by a reference and its title is the label shown to an editor:
[VoxChoiceSet]
[VoxTitle(nameof(Name))]
public class Color : IVoxEntity
{
// Built-in properties omitted.
public required virtual string Name { get; set; }
public virtual string? Hex { get; set; }
}
The marker belongs to the target entity type rather than every property that refers to it. References then use the normal Vox relation types and metadata:
public class ProductPimData
{
[VoxRelation(Name = "primaryColor", InverseName = "primaryColorOf")]
public virtual VoxReference<Color>? PrimaryColor { get; set; }
[VoxRelation(Name = "colors", InverseName = "products")]
public virtual IVoxRelationReferences<Color> Colors { get; set; } = default!;
}
The Admin UI presents a single reference to a choice set as a searchable combobox and a list or index-backed relation as a multi-select. References to ordinary entity types keep the scalable search dialog, and references to assets keep the media picker. This distinction is presentation metadata only; all of them remain ordinary Vox entity relations in the domain model and API.
Eg a Color entity type can be a choice set for a variant's color field in its VoxFieldValues specifications. Context
entity types such as Market, Channel and Language can be choice sets too, so the same entity drives both context
selection and ordinary relation fields.
Which choices are offered
A choice can be retired without changing what refers to it, eg a color that's no longer sold, a season that's over or a CVL entry that a PIM deactivated. A choice is one of three:
- Selectable: offered to editors, who may select it.
- Disabled: shown to editors, but they can't select it, with the reason why when there is one, eg "The season ended on 2026-09-30."
- Hidden: not offered at all.
Either way, the references that already have a choice that can't be selected keep it and still resolve it. What decides
it is an IVoxChoiceSelectability<TChoice> for the entity type of the choice set. The default asks a choice that
implements IVoxSelectableChoice, and offers every other choice. A VoxSelectability reads like an enum in the simple
case, and Because adds a reason:
[VoxChoiceSet]
public class Season : IVoxEntity, IVoxSelectableChoice
{
// Built-in properties omitted.
public virtual bool Inactive { get; set; }
public virtual DateOnly? EndsOn { get; set; }
// Virtual, like the other members of an entity
public virtual VoxSelectability GetSelectability() =>
Inactive ? VoxSelectability.Hidden
: EndsOn < DateOnly.FromDateTime(DateTime.UtcNow) ? VoxSelectability.Disabled.Because($"The season ended on {EndsOn:yyyy-MM-dd}.")
: VoxSelectability.Selectable;
}
When something other than the choice itself decides it, eg the assortment of a market or a rule in another system,
register your own for the entity type. Deriving it from VoxChoiceSelectability<TChoice> keeps what the choices decide
too:
public class SeasonSelectability(IPlanningSystem planning) : VoxChoiceSelectability<Season>
{
public override async Task<IReadOnlyList<VoxSelectability>> GetSelectabilityAsync(IReadOnlyList<Season> choices,
CancellationToken cancellationToken = default)
{
var open = await planning.GetOpenSeasonsAsync(cancellationToken);
return choices.Select(season => open.Contains(season.Id)
? GetSelectability(season)
: VoxSelectability.Disabled.Because("The season isn't open in the planning system.")).ToList();
}
}
services.AddScoped<IVoxChoiceSelectability<Season>, SeasonSelectability>();
The API marks every entity of a choice set it reads with _selectability, a batch at a time, also the published and
draft versions of an entity's content, eg "_selectability": { "state": "Disabled", "reason": "The season ended on 2026-09-30." }, without a reason when there's none. The Admin UI's choice controls and reference dialogs leave out the
hidden choices and show the disabled ones greyed out with the reason, and a selected choice that can't be selected any
more keeps a badge that says so until it's removed. The MCP server has the same _selectability in the entities it
reads, gives choice sets the choiceSet trait, and its descriptions tell agents to refer only to selectable choices.
Vox also rejects a write that adds a new reference to a choice that can't be selected: an editor's create, update or cell write, whether it comes from the Admin UI, the API, an Excel import or an MCP agent, gets a validation error at the field, eg "The Season 'summer-2025' can't be selected: The season ended on 2025-09-30." A reference that the entity had already is kept, also when other fields change, and publishing, merging releases, restoring history, imports, calculations and writes by the system, eg an integration that mirrors a PIM, aren't restricted.
A context type can also be a choice set, eg Market : IVoxEntity, IVoxContext, but the concepts are independent:
IVoxContext makes values vary by the type, while VoxChoiceSetAttribute describes how references to its entities can
be selected. Context selectors use the context entities' titles whenever they have them.
Dynamic selections
A selection factory separates the value stored in an action property from the label an editor sees:
public class CitySelection : IVoxSelectionFactory<string>
{
public Task<VoxSelectionPage<string>> SearchAsync(
VoxSelectionContext context,
VoxSelectionQuery query,
CancellationToken cancellationToken)
{
IReadOnlyList<VoxSelectionOption<string>> options =
[
new("STO", "Stockholm"),
new("GOT", "Gothenburg"),
];
return Task.FromResult(new VoxSelectionPage<string>(options));
}
public Task<IReadOnlyList<VoxSelectionOption<string>>> ResolveAsync(
VoxSelectionContext context,
IReadOnlyCollection<string> values,
CancellationToken cancellationToken)
{
// Resolve existing stored keys even when they aren't on the current search page.
throw new NotImplementedException();
}
}
public class Store : IVoxEntity
{
// Built-in properties omitted.
[Display(Name = "City", Prompt = "Choose a city")]
[VoxSelection<CitySelection>]
public required virtual string City { get; set; }
}
Factories are discovered from the annotation, registered as scoped dependencies and may use constructor injection.
They support scalar and collection properties whose element is a string, number, GUID or enum. SearchAsync supports
search text, cursor pagination and a requested page size. ResolveAsync gives the UI labels for values already stored
on an entity without requiring those values to occur on the first search page.
VoxSelectionContext contains the entity type, action, field path, current entity ID and the selected contexts. When
ValidateValue checks a submitted value, Values also holds the action's command. The admin asks for the options
without the form's other values, so Values is empty then, and the options of a field can't depend on another field,
eg states filtered by the selected country. Options are requested lazily from a field-specific API endpoint; factory
type names are never exposed.
By default a selection controls the editor but does not make its current options a domain constraint. This matters for
imports and external option sources that may be temporarily unavailable. Use AllowCustomValues = true for a combo
box that also accepts typed values. Use ValidateValue = true when options are authoritative: Vox resolves submitted
action values through the factory and rejects missing or disabled choices. Static authoritative sets can continue to
use [AllowedValues] or enums.
Vox validates selection annotations at startup. A factory must be a concrete DI-constructible class, implement exactly
one IVoxSelectionFactory<TValue>, and supply the scalar property type or the element type of a collection.
Topics and perspectives
Different tasks use different fields of an entity: content work uses a product's texts and images, buying its supplier and cost price, and warehouse planning its stock and dimensions. A perspective, eg Content, Buying or Warehouse, hides in the Admin UI the fields and entity types that don't matter to it, also those the user may read, eg so that a product's cost price isn't below twelve text fields in five languages.
It has two parts. In code, [VoxRelevantTo] marks fields and entity types with the topics they're relevant to, any
names that make sense for the application, and a field can have several:
public class Product : IVoxAuthoredEntity
{
public required virtual string Sku { get; set; }
[VoxRelevantTo("Content")]
public virtual ProductContent Content { get; set; } = new();
[VoxRelevantTo("Purchasing")]
public virtual VoxReference<Supplier>? Supplier { get; set; }
[VoxRelevantTo("Purchasing", "Pricing")]
public virtual decimal? CostPrice { get; set; }
[VoxRelevantTo("Warehouse")]
public virtual ProductDimensions Dimensions { get; set; } = new();
}
At runtime, an administrator makes perspectives out of topics, eg Buying with Purchasing and Pricing, see
perspectives. The rule is the same everywhere:
something without topics is shown in every perspective, and something with topics is shown in a perspective that
has at least one of them. In Buying, someone sees a product's SKU, supplier and cost price, and not its texts or
dimensions. So marking can be gradual: start with the handful of fields that clutter most, and everything else stays
visible.
- A field inside an object, list or dictionary inherits the topics of its property and can add its own, eg
Content.WeightmarkedWarehouseis shown in both Content and Warehouse. An object whose fields are all hidden isn't shown, rather than showing an empty section. Fields of kinds follow the same rules. - The fields of a field set or of
attribute values take the topics of the property they're stored in, so
marking
SpecificationswithContentshows or hides all of its fields together. - An entity type's topics decide whether it's in a perspective's navigation. With
[VoxRelevantTo]on the class, it has the topics it names; without, it has the topics of all its fields together, and one without any topics, eg aBrandwith an unmarked name, is in every perspective's navigation. Its pages can still be opened from a link or a reference in any perspective.
There's no configuration of a perspective per entity type: the same topics apply to every entity type, so choose
topics that make sense across them, by the activity rather than the kind of person, eg Pricing for the cost price of
a product and the discount of a campaign alike.
A perspective only narrows what someone browses, never what they confirm, record or deliberately chose, and it never changes the order or arrangement of anything. In the Admin UI, it hides the fields of the detail page and the Variations tab, the columns of lists from code, the choices to add a filter on a hidden field, subtitles and images whose field is hidden, the preview's fields, relations and their tabs whose declaring property is hidden (also from the other side and in "Used in"), sections and field tabs that have nothing left to show, entity types in the navigation, on shared links' tiles and on the lists screen, and findings about hidden fields, in a list's "Needs attention" and assessment filters too when the finding's definition names its field. It never hides the title, the id and the built-in fields, the create screen, inline creation and action dialogs, the History and Effects tabs, pins, filters already applied, or columns that someone picked for themselves. When something on the detail page is hidden, the page says so, eg "Some fields are hidden in the Buying perspective", with a way to show all fields.
/api/entity-types gives every field its topics as relevantTo, with the inherited ones included, and each entity
type and relation its own, so a client never repeats the rules. A perspective is not a permission: the hidden fields
are still in the API's responses to the Admin UI, and a field the person may not read stays hidden whichever
perspective they use. The MCP server reads from
the user's default perspective.
Personal changes
Everyone signed in can change the Admin UI for themselves, and only for themselves, without a deployment. Code is the default, and until someone changes something, they see what code says. A person can change:
- the layout of an entity type: its columns, subtitle, image and view, the relations shown, which relations have tabs of their own, each field's section, and each section's label, order and tab;
- the labels and descriptions of entity types, fields, actions and enum values, and an action's confirmation text;
- how a field is shown: its prompt, editor, data type and format;
- an entity type's icon, and the navigation, see my navigation.
The title and the tree come from code only, and so do units, short text, validation, permissions, field types and selections.
Changes are made in place, on the screens they affect: a list's columns, subtitle, image and view on the list, the relations, sections, tabs, labels and fields on the detail page, and the sidebar on My navigation. A changed setting is marked, eg "Section: Identity · changed by you · Reset", and each change has its own Reset, which brings back what code says without undoing the others: moving a field to the Identity section and moving the Warranty section to the Details tab are two changes. Setting a value equal to code is no change, and a text can be cleared on purpose, eg to hide a description from code. Nobody needs a permission to change their own presentation.
Columns are kept per perspective: a buyer who picks the product list's columns in Buying gets them in Buying, and in Content gets the columns from code, narrowed by that perspective, unless they pick columns there too. Columns someone picked are never hidden by the perspective they were picked in. Every other change is the same in every perspective.
A good personal change can become everyone's default. Copy as code writes the person's changes as code,
combined with what code says: [Display] attributes with labels, descriptions and GroupName, [VoxNavigation],
and the whole ConfigureLayout method of an entity type whose layout they changed, to replace the one in code. Once
the same value is in code, the personal change no longer differs from it and is removed.
When the model changes, eg a field is renamed in a model migration, a change that no longer fits is ignored, and the person sees it listed with a Reset where they make changes, so they can remove it or make it again. Migrations don't rewrite personal changes: someone who moved a renamed field to another section sees it back in its section from code until they move it again.
Personal changes only change what the Admin UI shows the person who made them: the entity types it reads from
/api/entity-types, the fields of field values, and /api/navigation. Everything else uses code: entity reads and the
titles of references, relation filters, effects, Excel and MCP. So a merchandiser who renamed "Eprel number" to
"EPREL" sees "EPREL" in their admin UI, while their colleagues and an MCP agent see "Eprel number".
The changes are kept in the person's preferences,
one per entity type and one for the navigation, and are removed with the user. Without user management, the
preferences belong to whoever the host says is signed in, or to one shared anonymous principal when the host has no
authentication, so the changes are shared by everyone who uses the Admin UI, as pins and saved filters are. A storage
provider that keeps no preferences, eg Redis alone, has no personal changes.
A client reads and makes changes at api/account/presentation: GET ?entityType=Product or GET ?navigation=true
returns what can be changed, with what code says, what the person sees, their own values, the choices, eg the
sections a field can be in, and the changes that no longer fit; POST changes sets or resets one, eg
{"kind": "Set", "target": {"kind": "EntityProperty", "entityType": "Item", "path": "eprelNumber"}, "property": "group", "value": "Identity"}, and checks it against the model; and GET code returns the code. The entity type's
tabs property is its relation tabs, and a section's tab property the field tab it's on.
See Build a UI with AI on top of Vox, Actions, validation and workflows and Assets and media.