Skip to content

Commit 02d4e42

Browse files
author
Sebastian-Debian
committed
README umfassend überarbeitet und erweitert
Badges für Build-Status, NuGet und Lizenz hinzugefügt. Features, Installationsanleitung, Nutzungsbeispiele (inkl. Razor-Code) und Konfigurationsoptionen für SimpleGrid und SimpleGridItem ergänzt. Hinweise zur Qualitätssicherung und Lizenzinformation klar dargestellt.
1 parent c0b05a0 commit 02d4e42

1 file changed

Lines changed: 85 additions & 1 deletion

File tree

README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,85 @@
1-
# Blazor.SimpleGrid
1+
# Blazor.SimpleGrid
2+
3+
![Build Status](https://github.com/CodingCodeSeb/Blazor.SimpleGrid/actions/workflows/dotnet-ci.yml/badge.svg)
4+
![NuGet Version](https://img.shields.io/nuget/v/Blazor.SimpleGrid)
5+
![License](https://img.shields.io/github/license/CodingCodeSeb/Blazor.SimpleGrid)
6+
7+
A modern, lightweight Blazor component library for creating **CSS Grid Layouts**. Define complex structures directly in Razor syntax without writing manual CSS.
8+
9+
---
10+
11+
## Features
12+
13+
- Type-Safe: Use Enums for alignments and flows instead of error-prone strings.
14+
- Intuitive Areas: Define layout zones with a simple pipe syntax (header | content).
15+
- Smart Logic: Automatic prioritization of Gap over individual spacing properties.
16+
- Flexible: Full support for Attribute Splatting (CSS classes, IDs, etc.).
17+
- Lightweight: No external CSS frameworks or JavaScript dependencies required.
18+
19+
---
20+
21+
## Installation
22+
23+
1. Install the package via NuGet:
24+
`dotnet add package Blazor.SimpleGrid`
25+
26+
2. Add the namespace to your _Imports.razor:
27+
`@using Blazor.SimpleGrid.Components`
28+
`@using Blazor.SimpleGrid.Enums`
29+
30+
---
31+
32+
## Usage
33+
34+
### Simple 3-Column Grid
35+
```razor
36+
<SimpleGrid Columns="1fr 1fr 1fr" Gap="20px">
37+
<SimpleGridItem>Item 1</SimpleGridItem>
38+
<SimpleGridItem>Item 2</SimpleGridItem>
39+
<SimpleGridItem>Item 3</SimpleGridItem>
40+
</SimpleGrid>
41+
```
42+
43+
### Complex Layout with Template Areas
44+
```razor
45+
<SimpleGrid Columns="250px 1fr"
46+
TemplateAreas="header header | sidebar content | footer footer"
47+
Gap="15px">
48+
49+
<SimpleGridItem Area="header">Header</SimpleGridItem>
50+
<SimpleGridItem Area="sidebar">Nav</SimpleGridItem>
51+
<SimpleGridItem Area="content">Main</SimpleGridItem>
52+
<SimpleGridItem Area="footer">Footer</SimpleGridItem>
53+
</SimpleGrid>
54+
```
55+
56+
---
57+
58+
## Configuration
59+
60+
### SimpleGrid (Container)
61+
- Columns: string (e.g., "1fr 100px")
62+
- Rows: string (optional)
63+
- Gap: string (combined shorthand)
64+
- TemplateAreas: string (separated by |)
65+
- Horizontal: HorizontalAlignment Enum
66+
- AutoFlow: GridAutoFlow Enum
67+
68+
### SimpleGridItem (Element)
69+
- Area: string (assigned area name)
70+
- ColumnSpan: int (span count)
71+
- RowSpan: int (span count)
72+
- Horizontal: HorizontalAlignment (Self)
73+
74+
---
75+
76+
## Quality Assurance
77+
78+
Verified by an automated test suite using bUnit and NUnit.
79+
Run tests locally with: `dotnet test`
80+
81+
---
82+
83+
## License
84+
85+
MIT License. See LICENSE file for details.

0 commit comments

Comments
 (0)