Modelling Different Types of Pages with Bloqs
1. Example: Activity Cards Page
var items = new List<GridItem>
{
new()
{
Size = 4,
Component = new CardComponent
{
ImageUri = "https://picsum.photos/1000?1",
ImageHeight = 300,
Area = PageBuilderExtensions.VerticalContainer(
PageBuilderExtensions.Html("Stay on Track."),
PageBuilderExtensions.BuildButton(
"Show notification",
"fa-solid fa-bell",
AppConstants.LogicBlocks.ShowNotification
)
),
},
},
new()
{
Size = 4,
Component = new CardComponent
{
ImageUri = "https://picsum.photos/1000?2",
ImageHeight = 300,
Area = PageBuilderExtensions.VerticalContainer(
PageBuilderExtensions.Html("Get It Done."),
PageBuilderExtensions.BuildButton(
"Hello World",
"fa-solid fa-terminal",
AppConstants.LogicBlocks.HelloWorld
)
),
},
},
new()
{
Size = 4,
Component = new CardComponent
{
ImageUri = "https://picsum.photos/1000?3",
ImageHeight = 300,
Area = PageBuilderExtensions.VerticalContainer(
PageBuilderExtensions.Html("Let's Tackle This!"),
PageBuilderExtensions.BuildButton(
"Show notification",
"fa-solid fa-bell",
AppConstants.LogicBlocks.ShowNotification
)
),
},
},
};
appBuilder.AddPage(
new Page
{
Id = AppConstants.Pages.CardsPage,
Title = "Activity Cards",
Name = "cards",
Area = ContainerComponent.Create(new GridComponent { Items = items }),
}
);2. Key Elements Explained
CardComponent
HtmlComponent
ButtonComponent
GridComponent
3. Beyond Lists and Forms
Key Points
Last updated