Relatude Help

Optional: an icon for the type

[Node(Icon = …)] sets the icon a type is shown with, in the admin UI and in applications built on the model, such as a CMS. Use a name from the icon library the server carries, written set:name, or the source of an SVG image:

[Node(Icon = "lucide:calendar")]            // monochrome: drawn in the colour of the text around it
public interface IEvent { /* ... */ }

[Node(Icon = "fluent-color:building-24")]   // in colour
public interface IVenue { /* ... */ }

A type without an icon shows the icon of the closest type it inherits from that has one. The library holds about 22,000 icons from seven open sets, named as Iconify names them: lucide, tabler and mdi in monochrome, and fluent-color, flat-color-icons, icon-park and fluent-emoji-flat in colour. The datamodel editor's Icon field has a picker over them and also takes pasted SVG. For a type from compiled code, the editor saves the icon as an override (§3.1).

An application that shows types gets the SVG of either kind from IconLibrary.ToSvg(icon) (namespace Relatude.DB.NodeServer.Icons). It refuses SVG that could run script, so what it returns is safe to show. An icon only changes how a type is shown: changing it rebuilds no state and no index.