Attribute splatting applies a collection of attribute names and values to an element in one operation. In a Blazor component, a parameter marked with CaptureUnmatchedValues receives attributes that do not match named parameters, and @attributes forwards them to the rendered element. section 34.2.1
Implement attribute splatting by:
- Declaring a Dictionary<string, object> parameter with [Parameter(CaptureUnmatchedValues = true)]. section 34.2.1
Forwarding attributes through SelectFilter
A SelectFilter component can accept values and a title while forwarding arbitrary HTML attributes to its select element. Use <SelectFilter values="@Cities" title="City" autofocus="true" name="city" required="true" />; the rendered select receives autofocus, name, and required. Inspect the page at /controllers to verify the generated attributes. section 34.2.1
