Navs ha tabs rehegua
Kuatiahaipyre ha techapyrã mbaꞌeichaitépa ojepurukuaa Bootstrap mbaꞌekuaarã jeguatarã oikevaꞌekue.
Base nav rehegua
Navegación ojeguerekóva Bootstrap-pe okomparti marcado general ha estilo, .nav
clase base guive estado activo ha desactivado peve. Embohasa umi mbo’esyry modificador rehegua emoambue hag̃ua peteĩteĩva estilo apytépe.
Pe componente base .nav
oñemopuꞌa flexbox reheve ha omeꞌe peteĩ pyenda mbarete oñemopuꞌa hag̃ua opaichagua componente navegación rehegua. Oike ipype peteĩ estilo ñemboyke (ombaꞌapo hag̃ua lista ndive), peteĩ enlace relleno umi área de golpe tuichavévape g̃uarã ha estilo básico desactivado.
Pe componente base .nav
ndoikéiva mba’eveichagua .active
estado. Ko’ã techapyrã oúvape oike pe clase, principalmente ohechauka haĝua ko clase particular ndodisparaiha mba’eveichagua estilo especial.
Oñembohasa hag̃ua estado activo umi tecnología pytyvõhárape, eipuru aria-current
atributo — eipuru page
valor página koꞌag̃aguápe g̃uarã, térã true
mbaꞌe koꞌag̃agua peteĩ conjunto-pe g̃uarã.
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Umi clase ojeporu opa rupi, upévare nde marcado ikatu ha’e súper flexible. Eipuru <ul>
s yvateguáicha, <ol>
iñimportánteramo ne mbaꞌekuéra ñemohenda, térã embojere nde mbaꞌeteéva peteĩ <nav>
elemento reheve. Umi .nav
jepuru rupi display: flex
, umi nav joajuha oñekomporta peteĩcha umi mba’e nav ojapova’erãmo’ãicha, ha katu pe marcado extra’ỹre.
<nav class="nav">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled">Disabled</a>
</nav>
Umi estilo ojeguerekóva
Omoambue estilo .nav
componente s rehegua umi modificador ha utilidad reheve. Embojehe’a ha embojoaju tekotevẽháicha, térã emopu’ã nde mba’éva.
Alineación horizontal rehegua
Emoambue alineación horizontal nde nav rehegua umi utilidad flexbox ndive . Por defecto, navs oñemohenda izquierda gotyo, ha katu ikatu remoambue fácilmente centro térã derecha gotyo.
Oñecentra con .justify-content-center
: 1.1.
<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Oñembojoaju derecho ndive .justify-content-end
: .
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Ñembo'yakua
Emoĩ apila nde navegación emoambuévo flex elemento dirección .flex-column
utilidad ndive. ¿Tekotevẽpa remoĩ apila umíva peteĩva umi jehechaukaha rehe ha katu nahániri ambuépe? Eipuru umi versión ombohováiva (por ejemplo, .flex-sm-column
).
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Jepiveguáicha, ikatu ojejapo navegación vertical <ul>
s ÿre, avei.
<nav class="nav flex-column">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled">Disabled</a>
</nav>
Fichas rehegua
Ogueraha nav básico yvate guive ha omoĩve .nav-tabs
mboꞌepy omoheñói hag̃ua peteĩ interfaz ficha rehegua. Eipuru umíva emoheñói hag̃ua región tabbable ore ficha JavaScript plugin rupive .
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Pastillas rehegua
Ejagarra upe HTML peteĩchagua, ha katu eipuru .nav-pills
hendaguépe:
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Omyenyhẽ ha ohustifika
Embojere nde .nav
's contenido ombohape hag̃ua ipypuku ojeguerekóva henyhẽva peteĩva mokõi mbo’esyry modificador-gui. Emyenyhẽ hag̃ua proporcionalmente opaite espacio ojeguerekóva nde .nav-item
s reheve, eipuru .nav-fill
. Ñañaminduꞌu opaite espacio horizontal ojeguerekoha, ha katu ndahaꞌei opaite mbaꞌe nav oguerekóva peteĩchagua ipypuku.
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Much longer nav link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Oipurúvo peteĩ <nav>
navegación -based, ikatu ojeheja rei oñeikotevẽháicha .nav-item
añoite .nav-link
umi elemento estilo <a>
rehegua.
<nav class="nav nav-pills nav-fill">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Much longer nav link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled">Disabled</a>
</nav>
Umi elemento ipukukue joja rehegua, eipuru .nav-justified
. Opaite espacio horizontal oguerekóta umi enlace nav, ha katu ojoavy umi .nav-fill
yvateguágui, opaite mbaꞌe nav oguerekóta peteĩchagua ipypuku.
<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Much longer nav link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Ojogua .nav-fill
techapyrãme oipurúva peteĩ <nav>
-based navegación.
<nav class="nav nav-pills nav-justified">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Much longer nav link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled">Disabled</a>
</nav>
Omba’apóva umi utilidad flex ndive
Oiméramo reikotevẽ umi variación nav ombohováiva, ehecha eipuru peteĩ serie de utilidades flexbox . Oĩramo jepeve verbose, ko’ã utilidad oikuave’ẽ tuichave personalización umi punto de ruptura ombohováiva rupi. Pe techapyrã iguýpe, ñande nav oñembojoajúta punto de ruptura ijyvatevévape, upéi ojeadapta peteĩ diseño horizontal-pe omyenyhẽva ancho ojeguerekóva oñepyrũvo punto de ruptura michĩvagui.
<nav class="nav nav-pills flex-column flex-sm-row">
<a class="flex-sm-fill text-sm-center nav-link active" aria-current="page" href="#">Active</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Longer nav link</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
<a class="flex-sm-fill text-sm-center nav-link disabled">Disabled</a>
</nav>
Accesibilidad rehegua
Eipurúramo navs eme’ẽ hag̃ua peteĩ barra de navegación, eñangareko emoĩ peteĩ role="navigation"
mba’e’oka túva lógicovévape <ul>
, térã embojere peteĩ <nav>
elemento jeguata tuichakue jerére. Ani remoĩ pe rol pe <ul>
ijehegui, péva ojokótagui oñemoherakuã haguã lista añetéva ramo umi tecnología oipytyvõva rupive.
Ñañamindu’u umi barra de navegación, jepémo ojehechaháicha estilo ficha ramo .nav-tabs
mbo’esyry ndive, noñeme’ẽiva’erã ,role="tablist"
térã role="tab"
atributo role="tabpanel"
. Koꞌãva oñemohenda porã umi interfaz ficha dinámica-pe g̃uarãnte, oñemombeꞌuháicha ARIA Authoring Practices Guide tabs pattern -pe . Ehecha JavaScript reko umi interfaz ficha dinámica rehegua ko aty’ípe techapyrãramo. Pe aria-current
atributo natekotevẽi umi interfaz ficha dinámica-pe ñande JavaScript oñatende guive estado ojeporavóva omoĩvo aria-selected="true"
ficha activa-pe.
Oipurúvo umi desplegable
Emoĩve menú desplegable orekóva HTML michĩmi extra ha umi desplegable JavaScript plugin .
Umi ficha orekóva umi desplegable
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Separated link</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
Pastillas orekóva gota
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Separated link</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
CSS rehegua
Variables rehegua
Oñemoĩve v5.2.0-pePehẽngue ramo Bootstrap CSS mbaꞌekuaarã oñembohapévape, navs koꞌág̃a oipuru CSS mbaꞌekuaarã tetãygua .nav
, .nav-tabs
, ha .nav-pills
oñembotuichave hag̃ua ñembohekopyrã tiempo real-pe. Umi mbaꞌekuaarã CSS mbaꞌekuaarãme g̃uarã oñemohenda Sass rupive, upévare oipytyvõ gueteri Sass jeporupyre, avei.
Pe .nav
clase base rehegua: .
--#{$prefix}nav-link-padding-x: #{$nav-link-padding-x};
--#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
@include rfs($nav-link-font-size, --#{$prefix}nav-link-font-size);
--#{$prefix}nav-link-font-weight: #{$nav-link-font-weight};
--#{$prefix}nav-link-color: #{$nav-link-color};
--#{$prefix}nav-link-hover-color: #{$nav-link-hover-color};
--#{$prefix}nav-link-disabled-color: #{$nav-link-disabled-color};
Pe .nav-tabs
clase modificador rehegua:
--#{$prefix}nav-tabs-border-width: #{$nav-tabs-border-width};
--#{$prefix}nav-tabs-border-color: #{$nav-tabs-border-color};
--#{$prefix}nav-tabs-border-radius: #{$nav-tabs-border-radius};
--#{$prefix}nav-tabs-link-hover-border-color: #{$nav-tabs-link-hover-border-color};
--#{$prefix}nav-tabs-link-active-color: #{$nav-tabs-link-active-color};
--#{$prefix}nav-tabs-link-active-bg: #{$nav-tabs-link-active-bg};
--#{$prefix}nav-tabs-link-active-border-color: #{$nav-tabs-link-active-border-color};
Pe .nav-pills
clase modificador rehegua:
--#{$prefix}nav-pills-border-radius: #{$nav-pills-border-radius};
--#{$prefix}nav-pills-link-active-color: #{$nav-pills-link-active-color};
--#{$prefix}nav-pills-link-active-bg: #{$nav-pills-link-active-bg};
Sass mba’ekuaarã
$nav-link-padding-y: .5rem;
$nav-link-padding-x: 1rem;
$nav-link-font-size: null;
$nav-link-font-weight: null;
$nav-link-color: var(--#{$prefix}link-color);
$nav-link-hover-color: var(--#{$prefix}link-hover-color);
$nav-link-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
$nav-link-disabled-color: $gray-600;
$nav-tabs-border-color: $gray-300;
$nav-tabs-border-width: $border-width;
$nav-tabs-border-radius: $border-radius;
$nav-tabs-link-hover-border-color: $gray-200 $gray-200 $nav-tabs-border-color;
$nav-tabs-link-active-color: $gray-700;
$nav-tabs-link-active-bg: $body-bg;
$nav-tabs-link-active-border-color: $gray-300 $gray-300 $nav-tabs-link-active-bg;
$nav-pills-border-radius: $border-radius;
$nav-pills-link-active-color: $component-active-color;
$nav-pills-link-active-bg: $component-active-bg;
JavaScript jepokuaa
Eipuru pe ficha JavaScript plugin —emoinge peteĩteĩ térã bootstrap.js
vore oñembohekopyréva rupive—embotuichave hag̃ua ñande ficha ha pastilla navegación rehegua emoheñói hag̃ua umi panel ficha rehegua contenido local rehegua.
Kóva ha’e peteĩ contenido tenda’i rehegua pe ficha Hogar contenido ojoajúva. Ojepysóramo ambue ficha oñembohasáta ko’ãva jehechauka ambuépe g̃uarã. Pe ficha JavaScript ombohasa mbo’esyry ocontrola hag̃ua contenido jehechauka ha estilo. Ikatu reipuru umi ficha, pastilla ha oimeraẽ ambue .nav
navegación -mombaretéva ndive.
This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Contact tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Disabled tab's associated content.
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home-tab-pane" type="button" role="tab" aria-controls="home-tab-pane" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile-tab-pane" type="button" role="tab" aria-controls="profile-tab-pane" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">Contact</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="disabled-tab" data-bs-toggle="tab" data-bs-target="#disabled-tab-pane" type="button" role="tab" aria-controls="disabled-tab-pane" aria-selected="false" disabled>Disabled</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="profile-tab-pane" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="contact-tab-pane" role="tabpanel" aria-labelledby="contact-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="disabled-tab-pane" role="tabpanel" aria-labelledby="disabled-tab" tabindex="0">...</div>
</div>
Oipytyvõ hag̃ua oike hag̃ua ne remikotevẽme, kóva omba’apo <ul>
-based markup ndive, ojehechaukaháicha yvateve, térã oimeraẽva “roll your own” markup arbitrario reheve. Eñamindu’u reiporúramo <nav>
, neremoĩriva’erã hese role="tablist"
directamente, kóva omboykétagui elemento rembiapo nativo peteĩ señal de navegación ramo. Upéva rangue, embohasa peteĩ elemento alternativo-pe (techapyrã iguýpe, peteĩ simple <div>
) ha embojere <nav>
ijerére.
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<button class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true">Home</button>
<button class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</button>
<button class="nav-link" id="nav-contact-tab" data-bs-toggle="tab" data-bs-target="#nav-contact" type="button" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</button>
<button class="nav-link" id="nav-disabled-tab" data-bs-toggle="tab" data-bs-target="#nav-disabled" type="button" role="tab" aria-controls="nav-disabled" aria-selected="false" disabled>Disabled</button>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="nav-disabled" role="tabpanel" aria-labelledby="nav-disabled-tab" tabindex="0">...</div>
</div>
Pe plugin tabs omba’apo avei umi pastilla ndive.
Kóva ha’e peteĩ contenido tenda’i rehegua pe ficha Hogar contenido ojoajúva. Ojepysóramo ambue ficha oñembohasáta ko’ãva jehechauka ambuépe g̃uarã. Pe ficha JavaScript ombohasa mbo’esyry ocontrola hag̃ua contenido jehechauka ha estilo. Ikatu reipuru umi ficha, pastilla ha oimeraẽ ambue .nav
navegación -mombaretéva ndive.
This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Contact tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Disabled tab's associated content.
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-target="#pills-home" type="button" role="tab" aria-controls="pills-home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-profile-tab" data-bs-toggle="pill" data-bs-target="#pills-profile" type="button" role="tab" aria-controls="pills-profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-contact-tab" data-bs-toggle="pill" data-bs-target="#pills-contact" type="button" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#pills-disabled" type="button" role="tab" aria-controls="pills-disabled" aria-selected="false" disabled>Disabled</button>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="pills-disabled" role="tabpanel" aria-labelledby="pills-disabled-tab" tabindex="0">...</div>
</div>
Ha umi pastilla vertical reheve. Iporãvéva, umi ficha vertical-pe g̃uarã, emoĩvaꞌerã avei aria-orientation="vertical"
pe ficha lista mbaꞌeryrúpe.
Kóva ha’e peteĩ contenido tenda’i rehegua pe ficha Hogar contenido ojoajúva. Ojepysóramo ambue ficha oñembohasáta ko’ãva jehechauka ambuépe g̃uarã. Pe ficha JavaScript ombohasa mbo’esyry ocontrola hag̃ua contenido jehechauka ha estilo. Ikatu reipuru umi ficha, pastilla ha oimeraẽ ambue .nav
navegación -mombaretéva ndive.
This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Disabled tab's associated content.
This is some placeholder content the Messages tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
This is some placeholder content the Settings tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav
-powered navigation.
<div class="d-flex align-items-start">
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<button class="nav-link active" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home" type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</button>
<button class="nav-link" id="v-pills-profile-tab" data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</button>
<button class="nav-link" id="v-pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#v-pills-disabled" type="button" role="tab" aria-controls="v-pills-disabled" aria-selected="false" disabled>Disabled</button>
<button class="nav-link" id="v-pills-messages-tab" data-bs-toggle="pill" data-bs-target="#v-pills-messages" type="button" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</button>
<button class="nav-link" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</button>
</div>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="v-pills-disabled" role="tabpanel" aria-labelledby="v-pills-disabled-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab" tabindex="0">...</div>
</div>
</div>
Accesibilidad rehegua
Umi interfaz dinámica ficha rehegua, oñemombeꞌuháicha ARIA Authoring Practices Guide tabs pattern -pe , oikotevẽ role="tablist"
, role="tab"
, role="tabpanel"
, ha atributo adicional aria-
ikatu hag̃uáicha ombohasa ijestructura, funcionalidad ha estado koꞌag̃agua umi tecnología oipytyvõva puruhárape (haꞌeháicha pantalla moñeꞌerã). Peteĩ jepokuaa iporãvéva ramo, romomarandu eipuru <button>
hag̃ua elemento umi ficha-pe g̃uarã, ko’ãva ha’égui control omoñepyrũva peteĩ ñemoambue dinámico, ndaha’éi umi enlace ohóva peteĩ página térã tenda pyahúpe.
Ojoajúvo ARIA Authoring Practices jeporupyre ndive, pe ficha ombaꞌapóva koꞌág̃a añoite ohupyty teclado enfoque. Oñepyrũvo JavaScript plugin, oñemohendavaꞌerã tabindex="-1"
opaite control ficha inactiva-pe. Pe ficha ombaꞌapóva koꞌág̃a oguereko rire enfoque, umi tecla cursor omombaꞌapo pe ficha mboyvegua/oúva, pe plugin omoambuévo rovingtabindex
heꞌiháicha. Ha katu, eñatendéke JavaScript plugin ndohechakuaáiha umi lista ficha horizontal ha vertical rehegua oñeñeꞌe jave umi interacción tecla cursor rehegua: tahaꞌe haꞌeháicha pe lista lista orientación, mokõive cursor yvate ha asu gotyo oho pe ficha mboyveguápe, ha cursor yvy gotyo ha asu gotyo oho pe ficha oúvape.
tabindex="0"
ne marcado-pe.
Oipurúvo umi atributo de datos rehegua
Ikatu emomba’apo peteĩ ficha térã pastilla jeguata ehai’ỹre mba’eveichagua JavaScript emombe’úvo data-bs-toggle="tab"
térã data-bs-toggle="pill"
peteĩ elemento ári. Eipuru ko’ã atributo dato rehegua .nav-tabs
térã .nav-pills
.
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="messages-tab" data-bs-toggle="tab" data-bs-target="#messages" type="button" role="tab" aria-controls="messages" aria-selected="false">Messages</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="settings-tab" data-bs-toggle="tab" data-bs-target="#settings" type="button" role="tab" aria-controls="settings" aria-selected="false">Settings</button>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab" tabindex="0">...</div>
<div class="tab-pane" id="profile" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">...</div>
<div class="tab-pane" id="messages" role="tabpanel" aria-labelledby="messages-tab" tabindex="0">...</div>
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab" tabindex="0">...</div>
</div>
JavaScript rupive
Emboguata umi vore vore’i JavaScript rupive (peteĩteĩva vore tekotevẽ oñemboguata peteĩteĩ):
const triggerTabList = document.querySelectorAll('#myTab button')
triggerTabList.forEach(triggerEl => {
const tabTrigger = new bootstrap.Tab(triggerEl)
triggerEl.addEventListener('click', event => {
event.preventDefault()
tabTrigger.show()
})
})
Ikatu emombaꞌapo peteĩteĩva ficha heta hendáicha:
const triggerEl = document.querySelector('#myTab button[data-bs-target="#profile"]')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
const triggerFirstTabEl = document.querySelector('#myTab li:first-child button')
bootstrap.Tab.getInstance(triggerFirstTabEl).show() // Select first tab
Efecto de desvanecimiento rehegua
Ojejapo hag̃ua umi ficha oñedesvanece, emoĩ .fade
peteĩteĩme .tab-pane
. Peteĩha vore vore oguerekovaꞌerã avei .show
ojehecha hag̃ua pe contenido ñepyrũrã.
<div class="tab-content">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel" aria-labelledby="messages-tab" tabindex="0">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel" aria-labelledby="settings-tab" tabindex="0">...</div>
</div>
Método-kuéra rehegua
Método ha transición asíncrono rehegua
Opaite API rembiaporã haꞌehína asíncrono ha oñepyrũ peteĩ jehasapa . Ojevy hikuái ohenóivape oñepyrũvove pe transición ha katu opa mboyve . Avei, oñemboykéta peteĩ ñehenói método rehegua peteĩ componente oñembohasáva rehe .
Omomba’apo ne contenido peteĩ elemento ficha ramo.
Ikatu ejapo peteĩ instancia ficha rehegua constructor ndive, techapyrãramo:
const bsTab = new bootstrap.Tab('#myTab')
Tapereko | Techaukaha |
---|---|
dispose |
Ohundi peteĩ elemento vore. |
getInstance |
Método estático ohejáva ndéve rehupyty hag̃ua instancia ficha rehegua ojoajúva peteĩ elemento DOM rehe, ikatu reipuru kóicha: bootstrap.Tab.getInstance(element) . |
getOrCreateInstance |
Método estático ombojevýva peteĩ instancia ficha ojoajúva peteĩ elemento DOM rehe térã omoheñói peteĩ pyahu en caso noñemoñepyrũi. Ikatu reiporu péicha: bootstrap.Tab.getOrCreateInstance(element) . |
show |
Oiporavo pe ficha oñemeꞌevaꞌekue ha ohechauka iparte ojoajúva hese. Oimeraẽ ambue vore ojeporavóva’ekue mboyve oiko ndojeporavoiva’ekue ha oñeñomi iparte ojoajúva hese. Ojevy ohenóivape ojehechauka mboyve añetehápe pe ficha vore (heꞌiséva oiko mboyve pe shown.bs.tab mbaꞌe ojehúva). |
Umi mba’e oikóva
Ohechauka jave peteĩ ficha pyahu, umi mbaꞌe ojehúva odispara koꞌã orden-pe:
hide.bs.tab
(pe ficha activa ko’áĝaguápe)show.bs.tab
(pe pestaña ojehechaukátavape)hidden.bs.tab
(pe ficha activa mboyvegua-pe, peteĩchagua pehide.bs.tab
evento-pe g̃uarã)shown.bs.tab
(pe pestaña ojehechauka ramóvape, peteĩchagua peshow.bs.tab
evento-pe g̃uarã)
Ndaipóriramo peteĩ ficha ndojejapóiva’ekue voi, upéicharamo umi hide.bs.tab
ha hidden.bs.tab
mba’e ojehúva ndojedisparamo’ãi.
Tipo de evento rehegua | Techaukaha |
---|---|
hide.bs.tab |
Ko mbaꞌe ojehúva ojedispara ojehechaukavaꞌerã jave peteĩ ficha pyahu (ha upéicha rupi oñeñomivaꞌerã pe ficha activa mboyvegua). Eipuru event.target ha event.relatedTarget emohenda hag̃ua pe ficha activa ko’áĝagua ha pe ficha pyahu pya’e ojejapótava, peteĩteĩ. |
hidden.bs.tab |
Ko mbaꞌe ojehúva oñembopu ojehechauka rire peteĩ ficha pyahu (ha upéicha oñeñomi pe ficha activa mboyvegua). Eipuru event.target ha event.relatedTarget emohenda hag̃ua pe ficha activa mboyvegua ha pe ficha activa pyahu, peteĩteĩ. |
show.bs.tab |
Ko mbaꞌe ojehúva odispara ficha jehechaukahápe, ha katu ojehechauka mboyve ficha pyahu. Eipuru event.target ha event.relatedTarget emohenda hag̃ua pe ficha activa ha pe ficha activa mboyvegua (oĩramo) peteĩteĩ. |
shown.bs.tab |
Ko mba’e ojehúva odispara ficha jehechaukahápe ojehechauka rire peteĩ ficha. Eipuru event.target ha event.relatedTarget emohenda hag̃ua pe ficha activa ha pe ficha activa mboyvegua (oĩramo) peteĩteĩ. |
const tabEl = document.querySelector('button[data-bs-toggle="tab"]')
tabEl.addEventListener('shown.bs.tab', event => {
event.target // newly activated tab
event.relatedTarget // previous active tab
})