How to dynamically adjust container heights in a flex layout using Tailwind CSS and React?

I’m working on a React application where I have multiple pricing cards (PricingCard) rendered using Tailwind CSS for styling. Each card consists of several sections, including a bullet points section (features) (i.e. on row 3 (LHS) that can vary in length.

I want to ensure that the left-hand side (LHS) container in the features section adjusts its height dynamically based on the content (features list), and that adjacent containers align properly, adjusting to the height of the container with the most text.

import React from 'react';

import { Link } from ‘react-router-dom’;

const PricingCard = ({ title, price, users, features, link, btnText, bgColor, textColor }) => {
return (
<div className={bg-white overflow-hidden }>

{/* row1 */}
  <div className="flex flex-row">
    <div className="w-3/5 flex flex-col bg-pricing-gray">
      <div className="w-full bg-white h-full"></div>
      <div className="w-10/12 py-4 flex justify-center items-center">
        <p className="text-2xl flex justify-center items-center pl-4 font-extrabold text-left min-h-14">{title}</p>
      </div>
      <div className="w-full bg-white h-full"></div>
    </div>
    <div className={`w-2/5 min-h-36 flex flex-col items-center justify-center py-6 px-4 pt-8 border-l-8 border-white ${textColor} ${bgColor}`}>
      <p className="text-2xl text-center font-extrabold ">{price}</p>
      {users && <p className="text-lg text-center">{users}</p> }
      
    </div>
  </div>

  {/* row2 to add cutting effect */}
  <div className="flex flex-row">
    <div className="w-3/5 flex flex-col items-center py-1 justify-center bg-pricing-gray"></div>
    <div className="w-2/5">
      <div className="w-full bg-white h-full"></div>
    </div>
  </div>

  {/* row3 for bullet points */}
  <div className="flex flex-row">
    {/* LHS WITH CONTENT */}
    <div className="w-11/12 flex flex-col items-center justify-center bg-pricing-gray">
      <ul className="list-disc list-inside space-y-4 px-4 py-8">
        {features.map((feature, index) => (
          <li key={index}>{feature}</li>
        ))}
      </ul>
    </div>
    {/* RHS ONLY BG */}
    <div className="w-1/12">
      <div className="w-full bg-white h-full"></div>
    </div>
  </div>

  {/* row4 for blue line */}
  <div className="flex flex-row">
    <div className={`w-11/12 flex flex-col items-center py-2 justify-center ${bgColor}`}></div>
    <div className="w-1/12">
      <div className="w-full bg-white h-full"></div>
    </div>
  </div>

  {/* row5 for white line */}
  <div className="flex flex-row">
    <div className="w-11/12 flex flex-col items-center py-2 justify-center bg-white"></div>
    <div className="w-1/12">
      <div className="w-full bg-white h-full"></div>
    </div>
  </div>

  {/* row6 for button text */}
  <div className="flex flex-row">
    <div className={`w-11/12 flex flex-col text-2xl ${bgColor} ${textColor} font-extrabold items-center py-4 cursor-pointer uppercase justify-center `}>
      <Link to={link}>{btnText}</Link>
    </div>
    <div className="w-1/12">
      <div className="w-full bg-white h-full"></div>
    </div>
  </div>
</div>

);
};

export default PricingCard;

The PricingCardRow component maps over pricingData to create instances or cards, where each card can have a different number of bullet points (features). I want to ensure that the left-hand side (LHS) container in the features section (Row3) adjusts its height dynamically based on the content (features list), and that adjacent containers align properly, adjusting to the height of the container with the most text.

import React from 'react';
import PricingCard from './PricingCard';
import pricingData from './pricingData'; // assuming pricingData is in a separate file

const PricingCardRow = () => {
  return (
    <>
      {pricingData.map((pricing, index) => (
        <PricingCard
          key={index}
          title={pricing.title}
          price={pricing.price}
          users={pricing.users}
          features={pricing.features}
          link={pricing.link}
          btnText={pricing.btnText || 'Get Started'}
          bgColor={pricing.bgColor || 'bg-theme-blue'} // default bgColor if not provided in pricingData
          textColor={pricing.textColor || 'text-white'} // default textColor if not provided in pricingData
        />
      ))}

    </>
  );
};

export default PricingCardRow;

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật