Grid

The grid component helps keeping layout consistent across various screen resolutions and sizes. FluentGrid comes with a 12-point grid system and contains 5 types of breakpoints that are used for specific screen sizes.

Examples

Default

Example

Justify

FlexStartCenterFlexEndSpaceBetweenSpaceAroundSpaceEvenly

Spacing

xs="12"
xs="12" sm="6" Hidden="SmAndDown"
xs="12" sm="6"
xs="6" sm="3"
xs="6" sm="3"
xs="6" sm="3"
xs="6" sm="3"
xs="3"
Download: 

No breakpoints

You can resize the panel using the slider in the bottom right-hand corner.

If no Breakpoints or if xs="0" is defined for a FluentGridItem component, this style will be applied: flex: 1; max-width: fit-content;.
In this example, the first item (the message) cannot be lower than 200px min-width: 200px;. To avoid that, the second item (the buttons) will be moved to the next line.

Example

Views must be setup in the Admin Portal to use this client application hosted by my company.

Setup Documentation
Download: 

Breakpoints

Breakpoints help you control your layout based on windows size:

Device
Code
Type
Range
Extra SmallxsSmall to large phone< 600px
SmallsmSmall to medium tablet< 960px
MediummdLarge tablet to laptop< 1280px
LargelgDesktop< 1920px
Extra LargexlHD and 4k< 2560px
Extra Extra Largexxl4k+ and ultra-wide>= 2560px

Hiding elements

For faster, mobile-friendly development, use responsive display classes to show and hide elements according to device. Avoid creating entirely different versions of the same site, but instead hide elements reactively for each screen size.

To hide elements, simply use the HiddenWhen attribute by selecting one of the following values or combining them with the | operator (see Enumeration flags)

To display an element only on a given range of screen sizes, you can combine a these values. e.g. GridItemHidden.Md | GridItemHidden.Lg will display the element for all screen sizes, except on medium and large devices.

AdaptiveRendering allows for not generating HTML code in a FluentGridItem based on the value of the HiddenWhen parameter. In other words, when AdaptiveRendering=false (default), the content of the FluentGridItem is simply hidden by CSS styles, whereas if AdaptiveRendering=true, the content of the FluentGridItem is not rendered by Blazor. This allows for fine-grained control over when HTML is generated or not, for example in a case where rendering the grid item takes a lot of time or leads to a lot of data being transferred.

GridItemHidden
X Small
< 600px
Small
600px - 959px
Medium
960px - 1279px
Large
1280px - 1919px
X Large
1920px - 2559px
XX Large
≥ 2560px
None
Xs
Sm
Md
Lg
Xl
Xxl
XsAndDown
SmAndDown
MdAndDown
LgAndDown
XlAndDown
XxlAndDown
XsAndUp
SmAndUp
MdAndUp
LgAndUp
XlAndUp
XxlAndUp

Documentation

FluentGrid Class

Parameters

Name
Type
Default
Description
AdaptiveRenderingbool
False
Gets or sets the adaptive rendering, which not render the HTML code when the item is hidden (true) or only hide the item by CSS (false).
Default is false.
ChildContentRenderFragment?
Gets or sets the child content of component.
JustifyJustifyContent
FlexStart
Defines how the browser distributes space between and around content items.
Spacingint
3
Gets or sets the distance between flexbox items, using a multiple of 4px.
Only values from 0 to 10 are possible.

EventCallbacks

Name
Type
Description
OnBreakpointEnterEventCallback<GridItemSize>
when page size falls within a specific size range (xs, sm, md, lg, xl, xxl).

Methods

Name
Parameters
Type
Description
DisposeAsyncValueTask
FluentGrid_MediaChangedAsyncstring size
Task

FluentGridItem Class

Parameters

Name
Type
Default
Description
AdaptiveRenderingbool?
Gets or sets the adaptive rendering, which not render the HTML code when the item is hidden (true) or only hide the item by CSS (false).
Default is false.
ChildContentRenderFragment?
Gapstring?
Gets or sets the gaps (gutters) between rows and columns.
See https://developer.mozilla.org/en-US/docs/Web/CSS/gap
HiddenWhenGridItemHidden?
Hide the item on the specified sizes (you can combine multiple values: GridItemHidden.Sm | GridItemHidden.Xl).
JustifyJustifyContent?
Defines how the browser distributes space between and around content items.
lgint?
The number of columns the item should span in the 12-column grid system.
Large (lg) devices (desktops, less than 1920px wide)
mdint?
The number of columns the item should span in the 12-column grid system.
Medium (md) devices (tablets, less than 1280px wide)
smint?
The number of columns the item should span in the 12-column grid system.
Small (sm) devices (landscape phones, less than 960px wide)
xlint?
The number of columns the item should span in the 12-column grid system.
Extra large (xl) devices (large desktops, less than 2560px wide)
xsint?
The number of columns the item should span in the 12-column grid system.
Extra Small (xs) devices (portrait phones, less than 600px wide)
xxlint?
The number of columns the item should span in the 12-column grid system.
Extra extra large (xxl) devices (larger desktops, more than 2560px wide)

Methods

Name
Parameters
Type
Description
GetHiddenAttributeGridItemHidden? hiddenWhen
string?
Returns the hidden attribute value for the specified GridItemHidden value.
FlexStart
Center
FlexEnd
SpaceBetween
SpaceAround
SpaceEvenly
None
Xs
XsAndDown
Sm
SmAndDown
Md
MdAndDown
Lg
LgAndDown
Xl
XlAndDown
Xxl
XxlAndUp
XlAndUp
LgAndUp
MdAndUp
SmAndUp
XxlAndDown
XsAndUp
FlexStart
Center
FlexEnd
SpaceBetween
SpaceAround
SpaceEvenly
An error has occurred. This application may no longer respond until reloaded. Reload 🗙