import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ColumnComponent } from '../../../../../ui-essentials/src/lib/components/layout/column';
@Component({
selector: 'ui-column-demo',
standalone: true,
imports: [CommonModule, FormsModule, ColumnComponent],
template: `
Column Layout Demo
Column Counts
@for (count of columnCounts; track count) {
{{ count }} Column{{ count !== '1' ? 's' : '' }}
{{ sampleText }}
}
Gap Sizes (2 Columns)
@for (gap of gaps; track gap) {
Gap: {{ gap }}
{{ shortText }}
}
Column Rules (3 Columns)
@for (rule of rules; track rule) {
Rule: {{ rule }}
{{ mediumText }}
}
Fill Types (3 Columns)
@for (fill of fills; track fill) {
Fill: {{ fill }}
{{ variableText }}
}
Responsive Layout
Resize your browser to see responsive column behavior
Responsive 4-Column Layout
Section 1
{{ sampleText }}
Section 2
{{ shortText }}
Section 3
{{ mediumText }}
Section 4
{{ variableText }}
Article Layout Example
The Future of Web Development
{{ longText }}
{{ mediumText }}
Key Benefits
Improved readability through better text flow
Enhanced visual hierarchy with column structures
Responsive design that adapts to screen sizes
Better content organization for long-form text
{{ shortText }}
Interactive Example
Interactive Column Layout
{{ sampleText }}
{{ mediumText }}
{{ shortText }}
`,
styleUrl: './column-demo.component.scss'
})
export class ColumnDemoComponent {
columnCounts = ['1', '2', '3', '4', '5', '6'] as const;
gaps = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
rules = ['none', 'solid', 'dashed', 'dotted'] as const;
fills = ['auto', 'balance', 'balance-all'] as const;
// Interactive controls
selectedCount = '3' as const;
selectedGap = 'md' as const;
selectedRule = 'solid' as const;
selectedResponsive = true;
// Sample text content
shortText = "This is a short paragraph to demonstrate column layout behavior with minimal text content.";
mediumText = "This is a medium-length paragraph that provides a good example of how text flows within column layouts. It contains enough content to show wrapping and distribution across multiple columns while remaining readable.";
sampleText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.";
longText = "Web development has evolved significantly over the past decade, with new frameworks, tools, and methodologies emerging to help developers create more efficient and maintainable applications. Modern web development practices emphasize component-based architecture, responsive design, and accessibility as core principles. The adoption of TypeScript has brought static typing to JavaScript, reducing runtime errors and improving developer productivity. CSS Grid and Flexbox have revolutionized layout design, making it easier to create complex, responsive layouts without relying on external frameworks.";
variableText = "This text demonstrates variable length content. Some paragraphs are longer, others shorter. This variation helps test how well the column layout handles different content lengths and maintains visual balance across columns.";
}