Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MudBlazor MudTabs –> Tab Content Height

I am trying to setup a MudBlazor MudTab panel. I’m struggling to figure out how I can make the tab’s content have a height of 100%.

I put together this chunk of test code to demonstrate the issue I am having:

<div style="height: 50vh; width: 50vw; padding: 5px; border: 2px solid blue;">

  <MudTabs Rounded="true" Centered="true" PanelClass="pa-6" Style="height: 100%; border: 2px solid red;">

    <MudTabPanel Text="Messages">

      <div style="height: 100%; border: 2px solid green;">

        <textarea style="height: 100%; width: 100%;">@Output</textarea>

      </div>

    </MudTabPanel>

  </MudTabs>

</div>


@code {

  String Output = String.Format("qqqq \n wwww \n eeee \n rrrr \n tttt");

}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I want the textarea to take up 100% of the space. Any suggestions on how I can accomplish this would be greatly appreciated! 🙂

>Solution :

MudTabs is a flexbox, so you can use the flex-grow-1 css utility class on the PanelClass property.

<div style="height: 50vh; width: 50vw; padding: 5px; border: 2px solid blue;">
  <MudTabs Rounded="true" Centered="true" PanelClass="pa-6 flex-grow-1" Style="height:100%; border: 2px solid red;">
    <MudTabPanel Text="Messages" >
      <div style="height: 100%; border: 2px solid green;">
        <textarea style="height: 100%; width: 100%;">@Output</textarea>
      </div>
    </MudTabPanel>
  </MudTabs>
</div>

MudBlazor Snippet

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading