### Clone BlazorKawaii GitHub Repository
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/installation-clone.txt
This command clones the BlazorKawaii project repository from GitHub to your local machine. It's the essential first step to setting up the development environment for this project.
```Shell
git clone https://github.com/phmatray/BlazorKawaii.git
```
--------------------------------
### Install BlazorKawaii NuGet Package
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This command adds the BlazorKawaii NuGet package to your .NET project, making the library's components available for use. It's the recommended method for integrating BlazorKawaii into your application.
```bash
dotnet add package BlazorKawaii
```
--------------------------------
### Run Blazor Project in Development Mode with .NET CLI
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This command starts the Blazor application in development mode, enabling hot-reloading for rapid iteration. It targets the 'Demo/Demo.csproj' project, which is the main application entry point.
```bash
dotnet watch run --project Demo/Demo.csproj
```
--------------------------------
### BlazorKawaii Component File Structure Example
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This snippet illustrates the typical file organization for a BlazorKawaii component, showing how SVG markup, C# partial class definitions for parameters, and SVG path constants are separated into distinct files for better modularity and maintainability.
```csharp
Components/
└── ComponentName/
├── ComponentName.razor # SVG markup
├── ComponentName.cs # C# partial class with parameters
└── ComponentNamePaths.cs # SVG path constants
```
--------------------------------
### Blazor Component Property Definition and Rendering
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/dynamic-properties.txt
Defines private fields within a Blazor component's `@code` block to control its state (mood, size, color) and then renders a child component, passing these fields as parameters. This demonstrates a common pattern for dynamic component rendering and data flow in Blazor applications.
```C#
private Mood currentMood = Mood.Happy;
private int size = 200;
private string color = "#FFD882";
```
```Blazor
```
--------------------------------
### Render Multiple BlazorKawaii Components with Dynamic Styling
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This advanced Razor example demonstrates how to programmatically iterate through all available mood expressions and render a 'Ghost' component for each. It includes an embedded C# code block to dynamically assign a color based on the current mood, showcasing conditional styling and component reusability.
```razor
@page "/custom-demo"
@using BlazorKawaii.Components
@using BlazorKawaii.Common
@* Style your components with CSS classes *@
@foreach (var mood in Enum.GetValues())
{
}
@code {
private string GetColorForMood(Mood mood) => mood switch
{
Mood.Sad => "#B0C4DE",
Mood.Happy => "#98FB98",
Mood.Lovestruck => "#FFB6C1",
_ => "#E0E4E8"
};
}
```
--------------------------------
### BlazorKawaii Publishing Commands
Source: https://github.com/phmatray/blazorkawaii/blob/main/CLAUDE.md
Commands to pack the BlazorKawaii library for NuGet distribution and publish the demo application for GitHub Pages deployment.
```Bash
# Pack the library for NuGet
dotnet pack BlazorKawaii/BlazorKawaii.csproj --configuration Release --output ./artifacts
# Publish demo for GitHub Pages
dotnet publish Demo/Demo.csproj --configuration Release --output ./dist -p:GHPages=true
```
--------------------------------
### Clone and Run BlazorKawaii Demo Application
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
These commands clone the BlazorKawaii repository from GitHub, navigate into its directory, restore all necessary project dependencies, and then run the included demo application. This allows developers to quickly set up and explore the library's features locally.
```bash
git clone https://github.com/phmatray/BlazorKawaii.git
cd BlazorKawaii
dotnet restore
dotnet run --project Demo/Demo.csproj
```
--------------------------------
### BlazorKawaii Development Build Commands
Source: https://github.com/phmatray/blazorkawaii/blob/main/CLAUDE.md
Commands for restoring dependencies, building the solution in debug or release mode, and running the demo application with or without watch mode during development.
```Bash
# Restore dependencies
dotnet restore
# Build the entire solution
dotnet build
# Build in Release mode
dotnet build --configuration Release
# Run the demo application
dotnet run --project Demo/Demo.csproj
# Watch mode for development
dotnet watch run --project Demo/Demo.csproj
```
--------------------------------
### Build Blazor Project with .NET CLI
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This command compiles the BlazorKawaii project. It prepares the application for execution or publishing by resolving dependencies and generating output binaries.
```bash
dotnet build
```
--------------------------------
### BlazorKawaii Testing and NuGet Validation Commands
Source: https://github.com/phmatray/blazorkawaii/blob/main/CLAUDE.md
Commands to run unit tests and validate the generated NuGet package using the Meziantou.Framework.NuGetPackageValidation tool.
```Bash
# Run tests (when available)
dotnet test
# Validate NuGet package
dotnet tool install -g Meziantou.Framework.NuGetPackageValidation.Tool
meziantou.validate-nuget-package ./artifacts/*.nupkg
```
--------------------------------
### Publish Blazor Project for GitHub Pages Manually with .NET CLI
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
These commands publish the Blazor application specifically for GitHub Pages deployment. The first command uses a custom property 'GHPages=true', while the second uses a predefined publish profile, both resulting in files optimized for GitHub Pages in the 'publish/wwwroot' directory.
```bash
dotnet publish Demo/Demo.csproj -c:Release -p:GHPages=true
```
```bash
dotnet publish Demo/Demo.csproj -p:PublishProfile=GitHubPages
```
--------------------------------
### Render BlazorKawaii Cat Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/basic-usage.txt
This snippet illustrates how to import required namespaces for a Blazor application and then render a custom component, in this case, the `` component from the BlazorKawaii library. It showcases typical Razor syntax for component integration.
```Razor
@using BlazorKawaii.Common
@using BlazorKawaii.Components
```
--------------------------------
### Using the BlazorKawaii Ghost Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/example-all-properties.txt
This snippet illustrates how to declare and configure the `Ghost` component within a Blazor application. It shows how to set properties like `Size`, `Mood`, `Color`, and apply custom CSS classes and styles to both the component's wrapper and its internal SVG element.
```Blazor
```
--------------------------------
### Styling a Kawaii Loading Screen with CSS
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/index.html
This CSS block defines the visual appearance and animations for a full-screen loading overlay. It includes styles for a centered container, animated Kawaii elements, pulsing dots, and a progress bar, providing a visually engaging loading experience.
```CSS
#app { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); font-family: 'Roboto', sans-serif; } .loading-container { text-align: center; color: white; } .loading-kawaii { animation: bounce 1.5s ease-in-out infinite; margin-bottom: 2rem; } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } } .loading-text { font-size: 1.5rem; font-weight: 300; letter-spacing: 0.5px; margin-bottom: 1rem; } .loading-dots { display: inline-flex; gap: 0.5rem; } .loading-dot { width: 10px; height: 10px; background-color: white; border-radius: 50%; animation: pulse 1.5s ease-in-out infinite; } .loading-dot:nth-child(1) { animation-delay: 0s; } .loading-dot:nth-child(2) { animation-delay: 0.2s; } .loading-dot:nth-child(3) { animation-delay: 0.4s; } @keyframes pulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } } .loading-progress { width: 200px; height: 4px; background-color: rgba(255, 255, 255, 0.3); border-radius: 2px; margin: 2rem auto 0; overflow: hidden; } .loading-progress-bar { height: 100%; background-color: white; border-radius: 2px; animation: progress 2s ease-out infinite; } @keyframes progress { 0% { width: 0%; } 50% { width: 70%; } 100% { width: 100%; }
```
--------------------------------
### Trigger GitHub Pages Deployment via Git Push
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This command pushes local changes to the 'main' branch of the remote Git repository. When GitHub Pages is configured with a GitHub Actions workflow, this action automatically triggers the build and deployment process for the Blazor application.
```bash
git push origin main
```
--------------------------------
### Render a BlazorKawaii Cat Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This Razor snippet demonstrates how to import the necessary BlazorKawaii namespaces and render a 'Cat' component within a Blazor application. It showcases how to customize the component's mood, size, and primary color using its parameters.
```razor
@using BlazorKawaii.Components
@using BlazorKawaii.Common
```
--------------------------------
### Render BlazorKawaii Cat Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/quick-start-example.txt
This snippet illustrates how to instantiate and configure the `Cat` component in a Blazor Razor file. It sets the cat's mood to 'Blissful', defines its size in pixels, and specifies its color using a hexadecimal value. This declarative syntax is typical for UI component usage in Blazor.
```Blazor
```
--------------------------------
### Conditional UI Rendering in Blazor
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/loading-states.txt
This Blazor component snippet illustrates how to conditionally display UI elements based on a boolean `isLoading` state. It renders a loading indicator with a `Ghost` component from the BlazorKawaii library when data is being fetched, and a success message once loaded.
```C#
@if (isLoading)
{
Loading your data...
}
else
{
Data loaded!
}
```
--------------------------------
### BlazorKawaii Component Parameters and Mood Expressions
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This API documentation defines the common parameters available for all BlazorKawaii SVG components, allowing customization of size, mood, color, and CSS styling. It also includes the 'Mood' enumeration, which specifies the various emotional expressions components can display.
```APIDOC
Component Parameters:
[Parameter] public int Size { get; set; } // Component size in pixels
[Parameter] public Mood Mood { get; set; } // Expression mood
[Parameter] public string Color { get; set; } // Primary color (hex)
[Parameter] public string? Class { get; set; } // CSS class for wrapper
[Parameter] public string? Style { get; set; } // CSS style for wrapper
[Parameter] public string? SvgClass { get; set; } // CSS class for SVG element
[Parameter] public string? SvgStyle { get; set; } // CSS style for SVG element
Mood Expressions Enum:
public enum Mood
{
Sad,
Shocked,
Happy,
Blissful,
Lovestruck,
Excited,
Ko
}
```
--------------------------------
### Define Blazor Component Parameters in C#
Source: https://github.com/phmatray/blazorkawaii/blob/main/README.md
This C# code defines the parameters for a new Blazor component. It uses the '[Parameter]' attribute to expose properties like 'Size', 'Mood', 'Color', and CSS-related attributes, allowing them to be set from the parent component.
```csharp
// NewComponent.cs
public partial class NewComponent
{
[Parameter] public int Size { get; set; } = 200;
[Parameter] public Mood Mood { get; set; } = Mood.Blissful;
[Parameter] public string Color { get; set; } = "#A6E191";
[Parameter] public string? Class { get; set; }
[Parameter] public string? Style { get; set; }
[Parameter] public string? SvgClass { get; set; }
[Parameter] public string? SvgStyle { get; set; }
}
```
--------------------------------
### Display Empty State UI in Blazor
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/empty-states.txt
This Blazor component snippet displays an empty state UI when a collection of items is empty. It includes an icon, a descriptive message, and a button to trigger an action (e.g., adding a new file), providing a user-friendly experience for empty data sets.
```C# Razor
@if (!items.Any())
{
No files found
}
```
--------------------------------
### Displaying an Error State in Blazor with Kawaii Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/error-states.txt
This Blazor snippet demonstrates how to conditionally render an error message and a Kawaii-themed browser illustration when an error occurs. It uses a boolean `hasError` flag to control visibility and customizes the `Browser` component's mood, size, and color to visually indicate a problem.
```C#
@if (hasError)
{
Oops! Something went wrong
Please try again later.
}
```
--------------------------------
### Scroll to Element Utility Function in JavaScript
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/index.html
This JavaScript function provides a utility to smoothly scroll the viewport to a specified HTML element by its ID. It includes error handling to gracefully manage cases where the element is not found or other scrolling issues occur, logging warnings to the console.
```JavaScript
window.scrollToElement = (elementId) => { try { const element = document.getElementById(elementId); if (element) { element.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } catch (error) { console.warn('Scroll error:', error); } };
```
--------------------------------
### Apply Floating Animation to a Blazor Component
Source: https://github.com/phmatray/blazorkawaii/blob/main/Demo/wwwroot/code-samples/styling-with-css.txt
This snippet defines a CSS animation named 'float' that causes an element to move vertically up and down. It then demonstrates how to apply this animation to a custom `` SVG component by assigning the 'floating-cat' class, resulting in a subtle, continuous floating effect.
```css
.floating-cat {
animation: float 3s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-20px); }
}
```
```html
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.