[Tabs] Ability to hide tabs header

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

The mat-tab-group should expose a property using which the header can be hidden. Setting the property to true should hide the header of the mat-tab-group.

What is the current behavior?

At the moment. in order to hide the header, I have to override the default styles of the class “.mat-tab-header” and set the display property to none along with setting component’s encapsulation to encapsulation: ViewEncapsulation.None. Given below is an example how I am currently hiding the tab header:

CSS Styles

.header-less-tabs.mat-tab-group .mat-tab-header {
  display: none;
}

TypeScript

import { Component, ViewEncapsulation } from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ],
  encapsulation: ViewEncapsulation.None
})
export class AppComponent  { 
}

Html Template

<mat-tab-group class="header-less-tabs">
  <mat-tab label="Tab 1">Content 1</mat-tab>
  <mat-tab label="Tab 2">Content 2</mat-tab>
</mat-tab-group>

What are the steps to reproduce?

Here is a link to StackBlitz Demo of what I am looking to achieve.

What is the use-case or motivation for changing an existing behavior?

I have an app where I am loading different contents/sections inside the mat-tab-group, and I am using a sidebar with the buttons to navigate. Also, the navigation happens from inside any tab. I do not have any routes in the app, so using “mat-tab-nav-bar” is not an option.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:48
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

28reactions
simeylacommented, May 18, 2018

I would very much like this feature too.

I have a list of products categories and only some have sub categories. I am displaying the products in a sub category in a tab control, but when there is only a single sub category I don’t want to display the tab control header. Would be much simpler template if I had this property.

8reactions
simeylacommented, Nov 28, 2018

Really wish some of these ‘low priority’ tasks that should be simple to implement could be prioritized more highly 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hide tab header area in an UltraTabcontrol | Infragistics Forums
The switching between the tabs is mostly controlled by the application. Therefore I'm searching a way to hide the tab header.
Read more >
Hide the TabControl header - Stack Overflow
You just set each TabItem s Visibility to Collapsed . You still see the tab content,...just not the tab header itself. Share.
Read more >
TabbedView - How to hide the Document's tab header when ...
The tabbedView.DocumentGroupProperties.ShowTabHeader shows/hide s all the headers but we only need to hide the headers of some tabs. BR,. JR.
Read more >
Tabpages hide "tab header" - MSDN - Microsoft
Is there a way to hide the tab header of a tabpage or change the apperance to look like a menustrip? I'm wanting...
Read more >
Firefox: Hide Native Tabs and Titlebar | by Xilin Sun - Medium
Firefox: Hide Native Tabs and Titlebar · /* hides the native tabs */ #TabsToolbar { visibility: collapse; } · #titlebar { visibility: collapse;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found