For my dashboard, I utilized reactJs along with react bootstrap to create a visually appealing layout. However, the varying sizes of the cards on the dashboard has resulted in gaps. Here's a snapshot of the issue:
https://i.sstatic.net/DErOn.png
To address this gap, I referred to the bootstrap flex documentation and decided to apply d-flex align-items-stretch
. This is how I implemented it:
<Row>
<Col lg="6" md="6" sm="12" className="d-flex align-items-stretch"> //I placed it on Col
<FrequentUsers />
</Col>
<Col lg="6" md="6" sm="12" className="d-flex align-items-stretch">
//Other content
</Col>
</Row>
By placing the
d-flex align-items-stretch
on the<Col>
tag, I was able to resolve the issue in my case. Applying it to the<Row>
tag or an external<div>
container did not yield the desired result.
The outcome met my expectations in terms of y-axis stretch, but unexpectedly caused x-axis shrinkage:
https://i.sstatic.net/Wcbk3.png
To counter this, I adjusted my grid layout to expand horizontally. Although the grid system continued to function properly, it failed to impact the card size, suggesting that the grid system may be "broken" at this point.
I suspect this behavior may be attributed to the d-flex
property. Despite referencing the documentation, which indicates full extension of content sides, the actual outcome differs. Please review the details in the documentation here.