` here, so without this rule every panel host stays
* `display: block` and the inactive panels stack vertically below the
* active one — pushing the active panel's content far below the tablist
* and shifting it as the user switches tabs. Hide the host itself when
* `active` isn't set so the active panel always renders directly below
* the tabs nav.
*/
static override styles = css`
:host(:not([active])) {
display: none;
}
`;
@property({ type: String }) name = '';
@property({ type: String }) label = '';
@property({ type: Boolean, reflect: true }) active = false;
@property({ type: Boolean, reflect: true }) disabled = false;
/** Opt out of the default `.fade` animation. Normally set by the parent `
`. */
@property({ type: Boolean, attribute: 'no-fade', reflect: true }) noFade = false;
override render() {
const classes = classMap({
'tab-pane': true,
fade: !this.noFade,
show: this.active,
active: this.active,
});
return html`
`;
}
}
defineElement('bs-tab-panel', BsTabPanel);
declare global {
interface HTMLElementTagNameMap {
'bs-tabs': BsTabs;
'bs-tab-panel': BsTabPanel;
}
}