import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { GridContainerComponent } from 'ui-essentials';
@Component({
selector: 'ui-grid-container-demo',
standalone: true,
imports: [CommonModule, FormsModule, GridContainerComponent],
template: `
GridContainer Demo
Advanced CSS Grid wrapper with template areas support, responsive column/row definitions, and auto-placement algorithms.
Basic Grid Layouts
Auto-fit Grid (Responsive)
@for (item of basicItems; track item.id) {
{{ item.label }}
}
Fixed 3-Column Grid
@for (item of basicItems; track item.id) {
{{ item.label }}
}
Gap Sizes
@for (gap of gaps; track gap) {
{{ gap }} Gap
@for (item of shortItems; track item.id) {
{{ item.label }}
}
}
Column Layouts
@for (colCount of columnCounts; track colCount) {
{{ colCount }} Columns
@for (item of getItemsForColumns(colCount); track item.id) {
{{ item.label }}
}
}
Auto Grid Types
Auto-fit (Items stretch to fill space)
@for (item of autoItems; track item.id) {
{{ item.label }}
}
Auto-fill (Empty columns maintained)
@for (item of autoItems; track item.id) {
{{ item.label }}
}
Advanced Features
Dense Grid (Auto-placement fills gaps)
Wide Item (2 cols)
Item 1
Tall Item
Item 2
Item 3
Extra Wide (3 cols)
Item 4
Item 5
Grid with Template Areas
Header
Sidebar
Main Content
Aside
Footer
Alignment Options
Justify Content: Center
Item 1
Item 2
Align Items: Center
Centered
Items
Vertically
Row Modes
@for (rowMode of rowModes; track rowMode) {
{{ rowMode }} Rows
@if (rowMode === 'min-content') {
Short
} @else if (rowMode === 'max-content') {
This is longer content to demonstrate max-content behavior
} @else {
Content for {{ rowMode }}
}