[Tabs] Header with icon+text not vertically aligned
See original GitHub issueBug, feature request, or proposal:
Tab with Icon and Text label not aligned vertically center, currently aligned bottom
What is the expected behavior?
Expect to align text and icon in middle. (as In Button with Icon and Label) Tab Label and Icon are aligned in
What is the current behavior?
Tab with Icon and Text label not aligned vertically center, currently aligned bottom
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
https://stackblitz.com/angular/rlqokrmnevel?file=app%2Ftabs-template-label-example.html
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>attach_file</mat-icon> Attach File
</ng-template>
<div class="demo-tab-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue.
#### What is the use-case or motivation for changing an existing behavior?
</div>
</mat-tab>
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@5.2.2
Is there anything else we should know?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Align material icon vertically - Stack Overflow
The "i" tag is for italic text. For icons, use "span" or "div". In this case, you probably want "span". – osiris.
Read more >Components - Bootstrap
Vertical variation. Make a set of buttons appear vertically stacked rather than horizontally. Split button dropdowns are not supported here. Button Button.
Read more >How to Create Divi Vertical Tabs (With & Without Plugin)
In this Divi tutorial, you'll learn how you can easily create Divi vertical tabs with examples using a custom CSS and plugin.
Read more >Components - NativeBase
Button component takes input such as: Text, Icon, Text with Icon. ... Make use of Left, Body and Right components to align the...
Read more >Bootstrap All CSS Classes - W3Schools
Class Description Example Category
.active Animates a striped progress bar Try it Progress Bars
.alert Creates an alert message box Try it Alerts
.alert‑info Light‑blue alert...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Workaround: Wrap the icon and text in a div container with class for:
BUT in my opinion (and I’m sure I’m not alone with it) the material ui framework has to handle it. Please add official support for icon and text.
@sujithtomy, what I found in specs is that when you have icon and text, you should align both at the center (horizontally) and the icon should be in one line and the text on the line below the icon. Like this:
MatTable
has a header row height of 48px, recommended for text or icon labels, but the specs say that to hold an icon + text, it should use a 72px-height header. You can modify its css to increase the height up to the right value if you really want icon + text in the label and also wants to follow the specs.[edit]: forgot to link the stackblitz demo => https://stackblitz.com/edit/angular-ikazee