Blazor page search entity

From IntentArchitect/Intent.Modules.NET · View interactive version

Blazor page search entity is an AI agent skill from the GitHub repository IntentArchitect/Intent.Modules.NET. Implements Blazor search and list entity pages using MudBlazor tables with optional filtering, preserving existing .razor.cs search, paging, sorting, service, and navigation behavior. Use when creating or implementing search, list, filter, lookup, or query entity pages in Blazor, including when an e

How to use this skill

Skill file

MANDATORY: Read Samples Before Implementation

STOP — you MUST read ALL of the following before writing ANY code:

Samples (in the SAME folder as this SKILL.md):

  1. search-entity-sample.razor
  2. search-entity-sample.razor.cs

Target component and project files:

  1. The target .razor and .razor.cs
  2. Related project files: request models, DTOs, enums, lookups, services

Design and styling context (search the project — these are NOT in the SKILL.md folder):

  1. design.md — search for this file anywhere in the project; read it in full if found; if absent, note the absence and continue without design context
  2. ux-tokens.css, ux-base.css, ux-components.css — read from the project's wwwroot folder if present; note any that are absent

If any sample file (items 1–2) cannot be accessed: stop immediately, confirm the SKILL.md folder location, retry from that location, and if still inaccessible report which file is missing. Do not proceed with partial implementation or approximation.

If items 5–6 are not found: note the absence and continue — they are reference context, not blocking.


MANDATORY: Match Sample Layout (Visual Structure)

When a sample exists, you MUST match the sample’s visual structure, not only its data-loading behavior.

Required process:

  1. Reuse the sample’s top-level component layout (hero header + main card) unless the user explicitly requests otherwise.
  2. If the sample uses shared utility classes (e.g. ux-gradient-primary, ux-fade-in-up), verify they exist by grepping for the class name as a substring (e.g. ux-gradient-primary) across all CSS files under wwwroot (including ux-tokens.css, ux-base.css, and ux-components.css). CSS utility classes are often defined as compound selectors (e.g. .mud-paper.ux-gradient-primary), so search for the class name alone, not the full selector. If the class name appears anywhere in any CSS file, it exists and must be used.

Required baseline layout (when supported by the target app):

Forbidden:


Preserve Existing Implementation

Use for: Search or list entity pages in Blazor with MudBlazor\

Do NOT use for: Add or edit forms, dialogs, or non-Blazor projects\

Source of truth: Existing .razor.cs file defines search criteria, paging, sorting, service calls, row actions, and navigation

You MAY add:

You MUST NOT:


1. Filters: Backend Contract Only

All search criteria must come from the existing backing search model or request object.

Required process:

  1. Identify the primary search or load method such as LoadServerData, LoadEntities, or SearchEntities
  2. Inspect the request DTO or backing search model used by that method
  3. Render only supported filter properties

Forbidden:


2. Choose The Correct Pattern

There are two list-page patterns and you must choose the one that matches the backing class.

Use the searchable pattern when the component exposes:

Use the simple grid pattern when the component:

Do not mix the two patterns in one page.


3. Map Criteria And Fields To MudBlazor Controls

| Type | Control |

| -------------------------------------- | ----------------------------------- |

| string named like search or keyword | Single search MudTextField |

| Other string | MudTextField |

| bool or nullable bool | MudSelect with All, Yes, and No |

| Enum or lookup | MudSelect with real options only |

| Number | MudNumericField |

| Date | MudDatePicker |

MudBlazor rules:


4. Search And Refresh Behavior

Search behavior:

Button placement:

Refresh behavior:


5. Table Output And Row Actions

Columns:

Searchable pattern:

Simple grid pattern:

Row actions:


6. Styling

Design and styling context

Apply the design token and CSS utility context from the files you read in the mandatory phase. Use var(--token) for all inline Style= attributes — never hardcode hex values. Verify utility classes (e.g. ux-fade-in-up, ux-gradient-primary) exist before applying. The design context informs styling choices only — it does not override layout structure.


Definition of Done

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.