Overview
The Intent.AI.Blazor module enables AI-powered implementation of Blazor UI components using pre-engineered prompt templates. This module leverages Large Language Models (LLMs) to generate production-ready Blazor views based on your application’s domain models, service contracts, and existing component patterns. Instead of manually writing repetitive CRUD UI code, you model your pages in the UI Designer and let AI generate complete component implementations following best practices.To use this feature, ensure that the required User Settings have been completed — including a valid API key for your selected AI provider.
What Gets Generated
Pre-Engineered UI Templates
The module provides six specialized prompt templates optimized for common MudBlazor patterns:Search Entity
List/grid views with filtering, sorting, pagination, and search functionality.
Add Entity
Create forms for new records with validation and submission handling.
Edit Entity
Update forms for existing records with data loading and save operations.
View Entity
Read-only detail views displaying entity information.
Add Entity Dialog
Modal dialogs for creating records inline.
Edit Entity Dialog
Modal dialogs for updating records inline.
Complete Blazor Components
The AI generates:- Complete
.razorview files with MudBlazor components - Form layouts with proper validation
- Data tables with sorting, filtering, and pagination
- Navigation logic between pages
- Dialog handling for modals
- Loading states and error handling
- Proper data binding to ViewModels
Pages/Customers/CustomerSearch.razor
Installation
Prerequisites
- An Intent Architect Blazor application
- The Intent.Blazor and Intent.Blazor.Components.MudBlazor modules installed
- An AI provider account (OpenAI, Azure OpenAI, or Anthropic)
- Valid API key configured in User Settings
Installation Steps
Install Blazor modules
Ensure you have the base Blazor modules installed:
Intent.Blazor and Intent.Blazor.Components.MudBlazor.Install Intent.AI.Blazor
In Intent Architect, right-click on your application and select Manage Modules. Search for
Intent.AI.Blazor and install it.Usage
Basic Workflow
Model your UI Component
In the UI Designer, create a Page or Dialog component. Use descriptive names like
CustomerSearch, AddCustomer, EditOrder.Connect to backend services
Use “Call Backend Service” to connect your component to Commands/Queries.
Influencing Factors
The quality and relevance of generated UI code depend on several factors:Intent Modeling
Before using Implement with AI, ensure:- Generated Code is up-to-date: Run the Software Factory to apply all outstanding code changes
- Component naming follows conventions: Use descriptive names like
CustomerSearch,AddCustomer,EditOrderthat indicate the component’s purpose - Service interactions are modeled: Use “Call Backend Service” to connect to Commands/Queries
- Navigations are defined: Model navigation operations and dialog invocations
- Data contracts exist: Ensure DTOs are properly defined for form bindings
Choosing the Right Template
The AI automatically selects a template based on your component name and structure, but you can guide it:| Component Pattern | Template | Use Case |
|---|---|---|
*Search, *List | Search Entity | Searchable, paginated lists |
Add*, Create* | Add Entity | Full-page create forms |
Edit*, Update* | Edit Entity | Full-page edit forms |
View*, Details* | View Entity | Read-only detail pages |
Add*Dialog | Add Entity Dialog | Modal create forms |
Edit*Dialog | Edit Entity Dialog | Modal edit forms |
Examples
Customer Search Page
Modeled Component:- Component Name:
CustomerSearch - Route:
/customers - Service Call:
GetAllCustomersQuery - Navigation: To
EditCustomerpage
Pages/Customers/CustomerSearch.razor
Add Customer Form
Modeled Component:- Component Name:
AddCustomer - Route:
/customers/add - Service Call:
CreateCustomerCommand - Navigation: Back to
CustomerSearchon success
Pages/Customers/AddCustomer.razor
Edit Order Dialog
Modeled Component:- Component Name:
EditOrderDialog - Type: Dialog
- Service Calls:
GetOrderByIdQuery,UpdateOrderCommand
Dialogs/Orders/EditOrderDialog.razor
Customizing Prompt Templates
You can extend or replace the built-in templates to support different component libraries or patterns. The module uses a template system that can be customized in your Intent Architect installation.Custom prompt template creation is an advanced topic. Contact Intent Architect support for guidance on creating custom templates for other component libraries like Blazorise or Bootstrap.
Best Practices
Descriptive Naming
Use clear component names that indicate purpose:
CustomerSearch, AddOrder, EditProductDialog.Model Backend Calls
Define service interactions in the UI Designer before generating components.
Review Generated Code
AI-generated components should be reviewed for UX best practices and accessibility.
Iterate with Feedback
Regenerate components with custom prompts to refine the UI implementation.
Integration with Other Modules
Blazor Core
Requires Intent.Blazor for base infrastructure.
MudBlazor Components
Uses Intent.Blazor.Components.MudBlazor for UI controls.
AI Auto Implementation
Generate backend handlers to support the UI.
HTTP Clients
Generated components call APIs through HTTP client proxies.
Related Resources
- Blazor UI Modeling with AI Tutorial
- MudBlazor Official Documentation
- Blazor Documentation - Microsoft Learn
- Intent.Common.AI Configuration
Next Steps
Auto Implementation
Generate backend logic for your UI
Authentication
Add user authentication to your Blazor app
Form Validation
Implement FluentValidation for forms

