Accordion / Tabset: adding close button in a tab header
See original GitHub issueIt is quite common to have a little close button on each tab of a tabset to close a given tab. Unfortunately we can’t easily add such a button today since content of the ngTabTitle
tab is added inside header’s link (<a>
element). This setup limits what users can put in a tab header.
Potential solutions:
- have users provide the whole link as part of the
ngTabTitle
template - the downside here is that users would have to manage theactive
anddisabled
states as well as a selection logic; - add a new directive (
ngTabHeader
) - if provided its content would be added after a link. The downside here is that there might be someone coming and saying that I want to insert sth before a link…
Not sure what is the best course of action here, to be discussed.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Developers - Accordion / Tabset: adding close button in a tab header -
Accordion / Tabset: adding close button in a tab header. ... It is quite common to have a little close button on each...
Read more >How to expand/collapse accordion tab when clicking a button?
All tabs are disabled and they are opened/closed programmatically only by clicking on the "Click me" buttons in their headers.
Read more >Responsive Accordion Tabs | Foundation for Sites 6 Docs
Basics. Either the Accordion Markup or the Tabs Markup can be used to responsively switch between the two components at different breakpoints.
Read more >Elementor Tab, Toggle or Accordion Remote Control
In this article we will learn how to open a specific toggle, tab and accordion by a button or link click on the...
Read more >Collapse - Bootstrap
You can use a link with the href attribute, or a button with the data-target attribute. In both cases, the data-toggle="collapse" is required....
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
This is not valid html, but works fine.
Another solution would be (if nesting templates is possible in ng2):
Since version
5.2.0
there is a newNgbNav
set of directives that fix this issue.NgbNav
is meant to replace theNgbTabset
component (completely deprecated in version6.0.0
) as a more flexible alternative.I suggest you migrate to it → https://ng-bootstrap.github.io/#/components/nav/overview