Element Reference
Everything this surface declares, in one place. What each construct means is in elements and decorations and control flow.
Elements#
A helper is named by its tag with only the first letter uppercased: Figcaption, not FigCaption.
An asterisk marks a void element, which takes no children
(BCF3016).
There are 100 of them, one for every element the HTML Living Standard lists as conforming and that the render tree can give meaning to.
Sections#
Address, Article, Aside, Footer, H1, H2, H3, H4, H5, H6, Header, Hgroup,
Main, Nav, Search, Section
Grouping#
Blockquote, Dd, Div, Dl, Dt, Figcaption, Figure, Hr*, Li, Menu, Ol, P,
Pre, Ul
Text-level#
A, Abbr, B, Bdi, Bdo, Br*, Cite, Code, Data, Dfn, Em, I, Kbd, Mark,
Q, Rp, Rt, Ruby, S, Samp, Small, Span, Strong, Sub, Sup, Time, U, Var,
Wbr*
Edits#
Del, Ins
Embedded#
Area*, Audio, Canvas, Embed*, Iframe, Img*, Map, Picture, Source*, Track*,
Video
Tabular#
Caption, Col*, Colgroup, Table, Tbody, Td, Tfoot, Th, Thead, Tr
Forms#
Button, Datalist, Fieldset, Form, Input*, Label, Legend, Meter, Optgroup,
Option, Output, Progress, Select, Selectedcontent, Textarea
Interactive#
Details, Dialog, Summary
Everything else: Element(tag)#
Element("my-widget") names an element no helper covers. That is custom elements and Web
Components, plus the standard elements deliberately left out: the document and <head> elements,
raw-text elements, template and slot, object, and the SVG and MathML elements. The tag has
to be a compile-time constant spelled like a tag name
(BCF3009). See
elements and decorations for the full list of what reaches
it and why.
Decorations on an element#
| Decoration | Writes |
|---|---|
.Attr(name, value) |
any attribute, by name |
.Class(value) |
the class channel, which folds (the class channel) |
.Role(value) |
role |
.On(name, handler) |
any event, by name |
.OnClick(handler) |
onclick |
.PreventDefault() |
the preceding event's preventDefault |
.StopPropagation() |
the preceding event's stopPropagation |
.Bind(…) |
a two-way binding (two-way binding) |
.Key(value) |
a diffing key, no markup (control flow) |
.Ref(capture) |
an element reference, no markup |
Every other decoration is a standard-derived attribute shortcut — one for each HTML Living Standard
attribute whose name spells directly as a C# identifier, such as .Id(value) for id and
.HttpEquiv(value) for http-equiv. There are 142. Each is shorthand rather than a separate
mechanism: .Id("x") and .Attr("id", "x") produce the same frame, and both count as the same
channel (BCF3010).
A shortcut takes bool where Blazor reads the attribute as conditional (true writes it empty,
false omits it) and string? otherwise.
Boolean-valued#
.Allowfullscreen, .Alpha, .Async, .Autofocus, .Autoplay, .Checked, .Controls,
.Default, .Defer, .Disabled, .Formnovalidate, .Headingreset, .Inert, .Ismap,
.Itemscope, .Loop, .Multiple, .Muted, .Nomodule, .Novalidate, .Open, .Playsinline,
.Readonly, .Required, .Reversed, .Selected, .Shadowrootclonable,
.Shadowrootcustomelementregistry, .Shadowrootdelegatesfocus, .Shadowrootserializable
String-valued#
.Abbr, .Accept, .AcceptCharset, .Accesskey, .Action, .Allow, .Alt, .As,
.Autocapitalize, .Autocomplete, .Autocorrect, .Blocking, .Charset, .Cite, .Closedby,
.Color, .Colorspace, .Cols, .Colspan, .Command, .Commandfor, .Content,
.Contenteditable, .Coords, .Crossorigin, .Data, .Datetime, .Decoding, .Dir, .Dirname,
.Download, .Draggable, .Enctype, .Enterkeyhint, .Fetchpriority, .For, .Form,
.Formaction, .Formenctype, .Formmethod, .Formtarget, .Headers, .Headingoffset, .Height,
.Hidden, .High, .Href, .Hreflang, .HttpEquiv, .Id, .Imagesizes, .Imagesrcset,
.Inputmode, .Integrity, .Is, .Itemid, .Itemprop, .Itemref, .Itemtype, .Kind, .Label,
.Lang, .List, .Loading, .Low, .Max, .Maxlength, .Media, .Method, .Min, .Minlength,
.Name, .Nonce, .Optimum, .Pattern, .Ping, .Placeholder, .Popover, .Popovertarget,
.Popovertargetaction, .Poster, .Preload, .Referrerpolicy, .Rel, .Rows, .Rowspan,
.Sandbox, .Scope, .Shadowrootmode, .Shadowrootslotassignment, .Shape, .Size, .Sizes,
.Slot, .Span, .Spellcheck, .Src, .Srcdoc, .Srclang, .Srcset, .Start, .Step,
.Tabindex, .Target, .Title, .Translate, .Type, .Usemap, .Value, .Width, .Wrap,
.Writingsuggestions
Constructs#
| Construct | Does |
|---|---|
If(condition, then, otherwise?) |
one branch, with disjoint sequence ranges |
ForEach(source, key, content) |
a keyed list |
Fragment(children…) |
groups children with no wrapper element |
Raw(html) |
injects trusted HTML verbatim |
Slot |
where a SlotView [ViewPart] places its caller's children |
Component<T>() |
calls a Blazor component |
Decorations on a component call#
| Decoration | Writes |
|---|---|
.Param(selector, value) |
one [Parameter] |
.Template(selector, template) |
a RenderFragment<T> parameter |
.Bind(selector, …) |
a two-way parameter binding (two-way binding) |
.Key(value) |
a diffing key |
.RenderMode(mode) |
the call-site render mode (installation and hosting) |
.Ref(capture) |
a component reference |
Child content written in brackets sets ChildContent, and it counts as a binding of that parameter
(BCF3007).
Base types#
| Type | For |
|---|---|
BodyComponentBase |
a component, overriding Body |
ChromeLayoutBase |
a layout, overriding Chrome (layouts) |
[ViewPart] |
a method whose markup expands into its caller |
SlotView |
the return type of a [ViewPart] that receives its caller's children |