Pattern for creating component sample/demo pages in the BlazorWebFormsComponents sample app
72
66%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.squad/skills/sample-pages/SKILL.mdEach component needs a sample page in the AfterBlazorServerSide sample app. This skill captures the conventions so new samples are consistent.
samples/AfterBlazorServerSide/Components/Pages/ControlSamples/{ComponentName}/Index.razorDo NOT use the older Pages/ControlSamples/ path.
@page "/ControlSamples/{ComponentName}"
@using BlazorWebFormsComponents
@using BlazorWebFormsComponents.Enums
<PageTitle>{ComponentName} Sample</PageTitle>
<h2>{ComponentName} Component Samples</h2>
<p>Brief description mentioning the Web Forms equivalent.</p>
<hr />
<h3>Feature Section</h3>
<p>Explanation of what this demo shows.</p>
<div class="demo-section">
<!-- Live component demo -->
</div>
<p>Code:</p>
<pre><code><!-- Escaped markup showing usage --></code></pre>
<hr />
<!-- More sections... -->
@code {
// State for demos
}When adding a new sample page, update BOTH files:
Components/Layout/NavMenu.razor — Add a <TreeNode> in the correct category, alphabetically orderedComponents/Pages/ComponentList.razor — Add an <li><a> link in the correct category, alphabetically ordered<pre><code> blocks with escaped Blazor markup (use @@ for @)<hr /> between sections<asp:Calendar>")@code {} block at the bottom of the fileIn <pre><code> blocks:
@ becomes @@< becomes <> becomes >See these files for reference:
Components/Pages/ControlSamples/Image/Index.razor — good structure with demo sectionsComponents/Pages/ControlSamples/CheckBox/Index.razor — good event handling demosComponents/Pages/ControlSamples/Calendar/Index.razor — comprehensive styled demos<PageTitle><pre><code> showing the markup9bf8669
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.