Lisiti kulu
Lisiti kuluw ye fɛn ye min bɛ se ka wuli ka bɔ a nɔ na ani min fanga ka bon walasa ka kunnafoni dɔw jira minnu bɛ tugu ɲɔgɔn na. Aw bɛ u ladilan ani k’u bonya walasa ka kunnafoni suguya o suguya dɛmɛ a kɔnɔ.
Misali jɔnjɔn
Lisiti kulu jɔnjɔnba ye lisi ye min ma labɛn ni lisi fɛnw ye ani kalasi bɛnnenw. Aw bɛ jɔ a kan ni sugandiliw ye minnu bɛ tugu o kɔ, walima ni aw yɛrɛ ka CSS ye i n’a fɔ a mago bɛ cogo min na.
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn naaninan dɔ
- Ani duurunan
<ul class="list-group">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
<li class="list-group-item">A fourth item</li>
<li class="list-group-item">And a fifth one</li>
</ul>
Fɛn minnu bɛ baara kɛ
A fara a kan .active
walasa .list-group-item
ka sugandili kɛlen jira sisan.
- Fɛn min bɛ baara kɛ
- Fɛn filanan
- Fɛn sabanan
- Fɛn naaninan dɔ
- Ani duurunan
<ul class="list-group">
<li class="list-group-item active" aria-current="true">An active item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
<li class="list-group-item">A fourth item</li>
<li class="list-group-item">And a fifth one</li>
</ul>
Fɛn minnu bɛ se ka baara kɛ
A fara a kan .disabled
walasa a .list-group-item
ka kɛ i n’a fɔ a tɛ se ka baara kɛ. A kɔlɔsi ko fɛn dɔw ni .disabled
fana bɛna JavaScript ladamulen wajibiya walasa k’u ka klikɛli ko kɛlenw bali ka ban pewu (misali la, jɛgɛnsira).
- Fɛn min ye fiyentɔ ye
- Fɛn filanan
- Fɛn sabanan
- Fɛn naaninan dɔ
- Ani duurunan
<ul class="list-group">
<li class="list-group-item disabled" aria-disabled="true">A disabled item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
<li class="list-group-item">A fourth item</li>
<li class="list-group-item">And a fifth one</li>
</ul>
Liens ani butɔni
Baara kɛ ni <a>
s walima <button>
s ye walasa ka lisi kulu fɛnw dilan minnu bɛ se ka kɛ ni hover, disabled ani active states ye ni farali .list-group-item-action
ye . An bɛ nin pseudo-classes ninnu faranfasi walasa lisi kulu minnu dilannen don ni fɛnw ye minnu tɛ ɲɔgɔn sɔrɔ (i n’a fɔ <li>
s walima <div>
s) olu kana click walima tap affordance di.
aw ye aw jija aw kana baara kɛ ni .btn
kalansen jɔnjɔnw ye yan .
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active" aria-current="true">
The current link item
</a>
<a href="#" class="list-group-item list-group-item-action">A second link item</a>
<a href="#" class="list-group-item list-group-item-action">A third link item</a>
<a href="#" class="list-group-item list-group-item-action">A fourth link item</a>
<a class="list-group-item list-group-item-action disabled">A disabled link item</a>
</div>
Ni <button>
s ye, i bɛ se fana ka baara kɛ ni disabled
fɛnɲɛnɛma ye .disabled
kalasi nɔ na. A fɔ man di nka, <a>
s tɛ dɛmɛ don disabled attribute ma.
<div class="list-group">
<button type="button" class="list-group-item list-group-item-action active" aria-current="true">
The current button
</button>
<button type="button" class="list-group-item list-group-item-action">A second button item</button>
<button type="button" class="list-group-item list-group-item-action">A third button item</button>
<button type="button" class="list-group-item list-group-item-action">A fourth button item</button>
<button type="button" class="list-group-item list-group-item-action" disabled>A disabled button item</button>
</div>
Aw bɛ a ko
Fàra ɲɔgɔn kan .list-group-flush
walasa ka dan dɔw Bɔ ani nkɔni bulamaw walasa ka lisi kulu fɛnw jira dakun na ka Taa dakun na bangebaga minɛn dɔ kɔnɔ (misali la, kartiw).
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn naaninan dɔ
- Ani duurunan
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
<li class="list-group-item">A fourth item</li>
<li class="list-group-item">And a fifth one</li>
</ul>
Nimɔrɔ bɛ a la
Aw bɛ .list-group-numbered
fɛn dɔ fara a kan (ani ka baara kɛ ni <ol>
fɛn dɔ ye) walasa ka sugandi ka don lisi kulu fɛnw na minnu bɛ nimɔrɔ ye. Jatedenw bɛ dilan CSS fɛ (a ni <ol>
s default browser styling tɛ kelen ye) walasa ka bila ka ɲɛ lisi kulu kɔnɔfɛnw kɔnɔ ani ka sira di ladamuni ɲuman ma.
Jateblaw bɛ Sɔrɔ ni counter-reset
kan <ol>
, ka sɔrɔ ka cogoya Kɛ k'u Blà ni ::before
pseudo-element ye <li>
ni kan counter-increment
ani content
.
- Lisiti kɔnɔfɛn dɔ
- Lisiti kɔnɔfɛn dɔ
- Lisiti kɔnɔfɛn dɔ
<ol class="list-group list-group-numbered">
<li class="list-group-item">A list item</li>
<li class="list-group-item">A list item</li>
<li class="list-group-item">A list item</li>
</ol>
Olu bɛ baara Kɛ kosɛbɛ ni ladamu kɔnɔkow ye fana.
-
Kumakun fitininKɔnɔkow ka ɲɛsin lisi fɛn ma
-
Kumakun fitininKɔnɔkow ka ɲɛsin lisi fɛn ma
-
Kumakun fitininKɔnɔkow ka ɲɛsin lisi fɛn ma
<ol class="list-group list-group-numbered">
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Subheading</div>
Content for list item
</div>
<span class="badge bg-primary rounded-pill">14</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Subheading</div>
Content for list item
</div>
<span class="badge bg-primary rounded-pill">14</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Subheading</div>
Content for list item
</div>
<span class="badge bg-primary rounded-pill">14</span>
</li>
</ol>
Dalen
Fàra ɲɔgɔn kan .list-group-horizontal
walasa ka lisi kulu fɛnw labɛncogo Yɛlɛma ka Bɔ jɔlen na ka Taa jɛgɛlen na kariyɔrɔw bɛɛ la. O cogo kelen na, aw bɛ jaabi suguya dɔ sugandi .list-group-horizontal-{sm|md|lg|xl|xxl}
walasa ka lisi kulu kɛ tilennen ye k’a daminɛ o kariyɔrɔ la min-width
’ . Sisan , lisi kuluw horizontal tɛ se ka fara ɲɔgɔn kan ni flush list kuluw ye.
ProTip: Aw b’a fɛ ka lisi kulu fɛnw sɔrɔ minnu bonya bɛ bɛn ɲɔgɔn ma ni u bɛ jɛgɛn wa? Aw bɛ dɔ fara .flex-fill
lisi kulu kɔnɔfɛn kelen-kelen bɛɛ kan.
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
- Fɛn dɔ
- Fɛn filanan
- Fɛn sabanan
<ul class="list-group list-group-horizontal">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-sm">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-md">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-lg">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-xl">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
<ul class="list-group list-group-horizontal-xxl">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
Kalanso minnu bɛ kɛ ka ɲɛsin ko kɛlenw ma
Baara kɛ ni contextual classes ye walasa ka fɛnw lisɛli cogoya jira ni u kɔkanna ni u kulɛri ye cogoya la.
- Lisiti kulu fɛn nɔgɔman dɔ
- Lisiti fɔlɔ kulu fɛn nɔgɔman dɔ
- Lisiti filanan yɔrɔ nɔgɔman dɔ
- A ye ɲɛtaa lisi kulu fɛn nɔgɔman ye
- Faratiw lisi kulu fɛn nɔgɔman dɔ
- Lakɔlɔsili lisi kulu fɛn nɔgɔman dɔ
- A simple info list kulu fɛn
- Yeelen lisi kulu fɛn nɔgɔman dɔ
- Dibi lisi kulu fɛn nɔgɔman dɔ
<ul class="list-group">
<li class="list-group-item">A simple default list group item</li>
<li class="list-group-item list-group-item-primary">A simple primary list group item</li>
<li class="list-group-item list-group-item-secondary">A simple secondary list group item</li>
<li class="list-group-item list-group-item-success">A simple success list group item</li>
<li class="list-group-item list-group-item-danger">A simple danger list group item</li>
<li class="list-group-item list-group-item-warning">A simple warning list group item</li>
<li class="list-group-item list-group-item-info">A simple info list group item</li>
<li class="list-group-item list-group-item-light">A simple light list group item</li>
<li class="list-group-item list-group-item-dark">A simple dark list group item</li>
</ul>
Kalanso minnu bɛ kɛ sigida la , olu fana bɛ baara kɛ ni .list-group-item-action
. A kɔlɔsi ko hover cogoyaw faralen don yan minnu tɛ misali tɛmɛnen na. Jamana fana bɛ dɛmɛ sɔrɔ .active
; a waleya walasa ka sugandili baarakɛta jira sigida lisi kulu yɔrɔ dɔ kan.
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">A simple default list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-primary">A simple primary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-secondary">A simple secondary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-success">A simple success list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-danger">A simple danger list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">A simple warning list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-info">A simple info list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-light">A simple light list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-dark">A simple dark list group item</a>
</div>
Kɔrɔ lasecogo dɛmɛni fɛɛrɛw ma
Baara kɛli ni kulɛri ye walasa ka kɔrɔ fara a kan, o bɛ taamasiyɛn yelen dɔrɔn de di, min tɛna lase dɛmɛni fɛɛrɛw baarakɛlaw ma – i n’a fɔ ɛkran kalanbagaw. Aw ye aw jija kunnafoni minnu jiralen don ni kulɛri ye, olu bɛ ye ka bɔ kɔnɔkow yɛrɛ la (misali la sɛbɛn yelen), walima u bɛ don a kɔnɔ fɛɛrɛ wɛrɛw fɛ, i n’a fɔ sɛbɛn wɛrɛw minnu dogolen don ni .visually-hidden
kalan ye.
Ni badgew ye
Badge fara lisi kulu fɛn o fɛn kan walasa ka jate kalanbaliw, baara ani fɛn wɛrɛw jira ni nafamafɛn dɔw dɛmɛ ye .
- Lisiti kɔnɔfɛn dɔ14 ye
- Lisiti kɔnɔfɛn filanan2 ye
- Lisiti kɔnɔfɛn sabanan1 ye
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
A list item
<span class="badge bg-primary rounded-pill">14</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
A second list item
<span class="badge bg-primary rounded-pill">2</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
A third list item
<span class="badge bg-primary rounded-pill">1</span>
</li>
</ul>
Kɔnɔkow minnu bɛ kɛ ka kɛɲɛ ni mɔgɔw sago ye
HTML fɛn o fɛn bɛ Se ka Fàra a kan, hali lisi kulu minnu bɛ ɲɔgɔn kan i n’a fɔ min bɛ duguma, ni flexbox utilities dɛmɛ ye .
Jɛkulu kɔnɔfɛnw tɔgɔ sɛbɛn
A bɛ tile 3 bɔYɔrɔ dɔw kɔnɔkow dakun dɔ kɔnɔ.
Ani sɛbɛn misɛnnin dɔw.Jɛkulu kɔnɔfɛnw tɔgɔ sɛbɛn
A bɛ tile 3 bɔYɔrɔ dɔw kɔnɔkow dakun dɔ kɔnɔ.
Ani dɔw ye sɛbɛn misɛnninw dabila.Jɛkulu kɔnɔfɛnw tɔgɔ sɛbɛn
A bɛ tile 3 bɔYɔrɔ dɔw kɔnɔkow dakun dɔ kɔnɔ.
Ani dɔw ye sɛbɛn misɛnninw dabila.<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active" aria-current="true">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small>3 days ago</small>
</div>
<p class="mb-1">Some placeholder content in a paragraph.</p>
<small>And some small print.</small>
</a>
<a href="#" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Some placeholder content in a paragraph.</p>
<small class="text-muted">And some muted small print.</small>
</a>
<a href="#" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Some placeholder content in a paragraph.</p>
<small class="text-muted">And some muted small print.</small>
</a>
</div>
Jateminɛ kɛyɔrɔw ani arajow
Bootstrap ka jatebɔyɔrɔw ni arajow bila lisi kulu kɔnɔfɛnw kɔnɔ ani ka u yɛrɛ kɛ i n’a fɔ a mago bɛ cogo min na. Aw bɛ se ka baara kɛ n’u ye ni <label>
s tɛ, nka aw hakili to a la ka fɛn dɔ aria-label
ni nafa dɔ fara a kan walasa ka se ka sɔrɔ.
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="firstCheckbox">
<label class="form-check-label" for="firstCheckbox">First checkbox</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="secondCheckbox">
<label class="form-check-label" for="secondCheckbox">Second checkbox</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckbox">
<label class="form-check-label" for="thirdCheckbox">Third checkbox</label>
</li>
</ul>
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="firstRadio" checked>
<label class="form-check-label" for="firstRadio">First radio</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="secondRadio">
<label class="form-check-label" for="secondRadio">Second radio</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="radio" name="listGroupRadio" value="" id="thirdRadio">
<label class="form-check-label" for="thirdRadio">Third radio</label>
</li>
</ul>
Aw bɛ se ka baara kɛ ni .stretched-link
s <label>
ye walasa ka lisi kulu fɛn bɛɛ kɛ fɛn ye min bɛ se ka digi.
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="firstCheckboxStretched">
<label class="form-check-label stretched-link" for="firstCheckboxStretched">First checkbox</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="secondCheckboxStretched">
<label class="form-check-label stretched-link" for="secondCheckboxStretched">Second checkbox</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="thirdCheckboxStretched">
<label class="form-check-label stretched-link" for="thirdCheckboxStretched">Third checkbox</label>
</li>
</ul>
CSS ye
Yɛlɛma-yɛlɛmaw
A farala a kan v5.2.0 kɔnɔBootstrap ka CSS fɛn caman sɛgɛsɛgɛli fɛɛrɛ min bɛ ka wuli, o hukumu kɔnɔ, lisi kuluw bɛ baara kɛ sisan ni sigida CSS fɛn caman sɛgɛsɛgɛli ye on .list-group
for for enhanced real-time customization. Nafa minnu bɛ CSS fɛn caman sɛgɛsɛgɛli la, olu bɛ sigi Sass fɛ, o la Sass ka ladamuni bɛ dɛmɛ hali bi, o fana.
--#{$prefix}list-group-color: #{$list-group-color};
--#{$prefix}list-group-bg: #{$list-group-bg};
--#{$prefix}list-group-border-color: #{$list-group-border-color};
--#{$prefix}list-group-border-width: #{$list-group-border-width};
--#{$prefix}list-group-border-radius: #{$list-group-border-radius};
--#{$prefix}list-group-item-padding-x: #{$list-group-item-padding-x};
--#{$prefix}list-group-item-padding-y: #{$list-group-item-padding-y};
--#{$prefix}list-group-action-color: #{$list-group-action-color};
--#{$prefix}list-group-action-hover-color: #{$list-group-action-hover-color};
--#{$prefix}list-group-action-hover-bg: #{$list-group-hover-bg};
--#{$prefix}list-group-action-active-color: #{$list-group-action-active-color};
--#{$prefix}list-group-action-active-bg: #{$list-group-action-active-bg};
--#{$prefix}list-group-disabled-color: #{$list-group-disabled-color};
--#{$prefix}list-group-disabled-bg: #{$list-group-disabled-bg};
--#{$prefix}list-group-active-color: #{$list-group-active-color};
--#{$prefix}list-group-active-bg: #{$list-group-active-bg};
--#{$prefix}list-group-active-border-color: #{$list-group-active-border-color};
Sass bεε bε bεn
$list-group-color: $gray-900;
$list-group-bg: $white;
$list-group-border-color: rgba($black, .125);
$list-group-border-width: $border-width;
$list-group-border-radius: $border-radius;
$list-group-item-padding-y: $spacer * .5;
$list-group-item-padding-x: $spacer;
$list-group-item-bg-scale: -80%;
$list-group-item-color-scale: 40%;
$list-group-hover-bg: $gray-100;
$list-group-active-color: $component-active-color;
$list-group-active-bg: $component-active-bg;
$list-group-active-border-color: $list-group-active-bg;
$list-group-disabled-color: $gray-600;
$list-group-disabled-bg: $list-group-bg;
$list-group-action-color: $gray-700;
$list-group-action-hover-color: $list-group-action-color;
$list-group-action-active-color: $body-color;
$list-group-action-active-bg: $gray-200;
Mixinw (Mixins).
Baara bɛ Kɛ ni ɲɔgɔn ye ni $theme-colors
walasa ka contextual variant classes (daɲɛw danfaralanw) Sɔrɔ .list-group-item
s.
@mixin list-group-item-variant($state, $background, $color) {
.list-group-item-#{$state} {
color: $color;
background-color: $background;
&.list-group-item-action {
&:hover,
&:focus {
color: $color;
background-color: shade-color($background, 10%);
}
&.active {
color: $white;
background-color: $color;
border-color: $color;
}
}
}
}
Bukulu
Loop min bɛ modifier classes (daɲɛw sɛgɛsɛgɛli) lawuli ni list-group-item-variant()
mixin ye.
// List group contextual variants
//
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states.
@each $state, $value in $theme-colors {
$list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
$list-group-variant-color: shift-color($value, $list-group-item-color-scale);
@if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
$list-group-variant-color: mix($value, color-contrast($list-group-variant-bg), abs($list-group-item-color-scale));
}
@include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
}
JavaScript kɛcogo
Baara kɛ ni JavaScript plugin tab ye—aw k’a don a kelen-kelen na walima ka tɛmɛ bootstrap.js
dosiye lajɛlen fɛ—walasa k’an ka lisi kulu bonya walasa ka sigida kɔnɔkow tablɛtiw dilan.
<div class="row">
<div class="col-4">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" id="list-home-list" data-bs-toggle="list" href="#list-home" role="tab" aria-controls="list-home">Home</a>
<a class="list-group-item list-group-item-action" id="list-profile-list" data-bs-toggle="list" href="#list-profile" role="tab" aria-controls="list-profile">Profile</a>
<a class="list-group-item list-group-item-action" id="list-messages-list" data-bs-toggle="list" href="#list-messages" role="tab" aria-controls="list-messages">Messages</a>
<a class="list-group-item list-group-item-action" id="list-settings-list" data-bs-toggle="list" href="#list-settings" role="tab" aria-controls="list-settings">Settings</a>
</div>
</div>
<div class="col-8">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="list-home" role="tabpanel" aria-labelledby="list-home-list">...</div>
<div class="tab-pane fade" id="list-profile" role="tabpanel" aria-labelledby="list-profile-list">...</div>
<div class="tab-pane fade" id="list-messages" role="tabpanel" aria-labelledby="list-messages-list">...</div>
<div class="tab-pane fade" id="list-settings" role="tabpanel" aria-labelledby="list-settings-list">...</div>
</div>
</div>
</div>
Baara kɛ ni data attributes ye
I bɛ se ka lisi kulu navigatiɔn dɔ baara k’a sɔrɔ i ma JavaScript si sɛbɛn ni i data-bs-toggle="list"
ye fɛn dɔ jira dɔrɔn walima a kan. Baara kɛ ni nin kunnafonidilanw ye .list-group-item
.
<div role="tabpanel">
<!-- List group -->
<div class="list-group" id="myList" role="tablist">
<a class="list-group-item list-group-item-action active" data-bs-toggle="list" href="#home" role="tab">Home</a>
<a class="list-group-item list-group-item-action" data-bs-toggle="list" href="#profile" role="tab">Profile</a>
<a class="list-group-item list-group-item-action" data-bs-toggle="list" href="#messages" role="tab">Messages</a>
<a class="list-group-item list-group-item-action" data-bs-toggle="list" href="#settings" role="tab">Settings</a>
</div>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel">...</div>
<div class="tab-pane" id="profile" role="tabpanel">...</div>
<div class="tab-pane" id="messages" role="tabpanel">...</div>
<div class="tab-pane" id="settings" role="tabpanel">...</div>
</div>
</div>
JavaScript fɛ
Tabbable list item daminɛ JavaScript fɛ (list item kelen-kelen bɛɛ ka kan ka baara kɛ kelen-kelen):
const triggerTabList = document.querySelectorAll('#myTab a')
triggerTabList.forEach(triggerEl => {
const tabTrigger = new bootstrap.Tab(triggerEl)
triggerEl.addEventListener('click', event => {
event.preventDefault()
tabTrigger.show()
})
})
Aw bɛ se ka lisi kelen-kelen bɛɛ baara cogo caman na:
const triggerEl = document.querySelector('#myTab a[href="#profile"]')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
const triggerFirstTabEl = document.querySelector('#myTab li:first-child a')
bootstrap.Tab.getInstance(triggerFirstTabEl).show() // Select first tab
Fade nɔ ye
Walasa ka tabs panel fade in kɛ, i ka dɔ fara .fade
u kelen-kelen bɛɛ .tab-pane
kan . Tablo fɔlɔ fana ka kan .show
ka kɛ sababu ye ka kɔnɔko fɔlɔw kɛ fɛn yetaw ye.
<div class="tab-content">
<div class="tab-pane fade show active" id="home" role="tabpanel">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
</div>
Fɛɛrɛw
Fɛɛrɛ minnu tɛ kelen ye ani fɛn caman tigɛli
API fɛɛrɛw bɛɛ ye asynchrone ye ani ka tɛmɛsira dɔ daminɛ . u bɛ segin welebaga ma ni wuli daminɛna dɔrɔn nka sanni a ka ban . Ka fara o kan, fɛɛrɛ weleli min bɛ kɛ tɛmɛsira yɔrɔ dɔ kan, o bɛna jate .
aw ye an ka JavaScript sɛbɛnw lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ .
A bɛ i ka kɔnɔkow baara i n’a fɔ tab element.
Aw bɛ se ka tab misali dɔ Dabɔ ni constructeur ye, misali la:
const bsTab = new bootstrap.Tab('#myTab')
Kɛcogo | Cogojirali |
---|---|
dispose |
A bɛ element dɔ ka tab tiɲɛ. |
getInstance |
Static method min b’a to i bɛ se ka tab instance sɔrɔ min bɛ tali kɛ DOM element dɔ la, i bɛ se ka baara kɛ n’a ye nin cogo la: bootstrap.Tab.getInstance(element) . |
getOrCreateInstance |
Fɛɛrɛ jɔlen min bɛ tab misali dɔ Lasegin min bɛ tali Kɛ DOM fɛn dɔ la walima ka kura Dabɔ n'a ma Daminɛ. Aw bɛ se ka baara kɛ n’a ye nin cogo la: bootstrap.Tab.getOrCreateInstance(element) . |
show |
A bɛ tab dilen sugandi ani k’a ni ɲɔgɔn cɛ panne jira. Tab wɛrɛ o wɛrɛ min tun sugandira ka tɛmɛ, o bɛ kɛ sugandibali ye ani a ni a ni ɲɔgɔn cɛ panneau bɛ dogo. A bɛ segin welebaga ma sani tab pane ka jira tiɲɛ na (o kɔrɔ ye ko sanni ko shown.bs.tab in ka kɛ). |
Ko minnu kɛra
Ni tab kura jira, ko kɛlenw bɛ tasuma don nin cogo la:
hide.bs.tab
(tab min bɛ baara la sisan)show.bs.tab
(tabu min bɛna jira, o kan)hidden.bs.tab
(tab active tɛmɛnen kan, o nihide.bs.tab
ko kɛlen ta ye kelen ye)shown.bs.tab
(tab min jirala sisan, o min bɛ baara kura kɛ, o nishow.bs.tab
ko kɛlen ta ye kelen ye)
Ni tab si tun tɛ baara la kaban, o tuma na hide.bs.tab
ani hidden.bs.tab
ko kɛlenw tɛna ci.
Ko kɛlen suguya | Cogojirali |
---|---|
hide.bs.tab |
O ko in bɛ tasuma Bɔ ni tablo kura dɔ ka kan ka jira (wa o cogo la tab baarakɛta tɛmɛnen ka kan ka dogo). Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tab min bɛ baara la sisan ani tab kura min bɛna kɛ sɔɔni, o laɲini, o cogo kelen na. |
hidden.bs.tab |
O ko in bɛ tasuma Bɔ tab kura jiralen kɔ (wa o cogo la tab baarakɛta tɛmɛnen bɛ dogo). Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tab baarakɛta tɛmɛnen ni tab baarakɛta kura laɲini, o cogo kelen na. |
show.bs.tab |
Nin ko in bɛ tasuma don tab jirali la, nka sanni tab kura ka jira. Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tablo active ani tab active tɛmɛnen (ni o bɛ sɔrɔ) laɲini. |
shown.bs.tab |
Nin ko in bɛ tasuma don tab jirali la tab jiralen kɔfɛ. Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tablo active ani tab active tɛmɛnen (ni o bɛ sɔrɔ) laɲini. |
const tabElms = document.querySelectorAll('a[data-bs-toggle="list"]')
tabElms.forEach(tabElm => {
tabElm.addEventListener('shown.bs.tab', event => {
event.target // newly activated tab
event.relatedTarget // previous active tab
})
})