Vaega ki
Tu'u fa'atasi se fa'asologa o fa'amau i luga o se laina e tasi ma le vaega fa'amau, ma fa'amalo malosi i latou i le JavaScript.
Fa'ata'ita'iga fa'avae
Afifi se faasologa o faamau i .btn
totonu .btn-group
. Fa'aopoopo i luga o le leitio JavaScript ma le fa'ailoga o le pusa siaki fa'atasi ma a matou fa'amau fa'amau .
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-secondary">Left</button>
<button type="button" class="btn btn-secondary">Middle</button>
<button type="button" class="btn btn-secondary">Right</button>
</div>
Ia mautinoa sa'o role
ma aumai se igoa
Ina ia mafai e tekinolosi fesoasoani (e pei o lau faitau mata) e faʻaalia ai le faʻavasegaina o faʻamau, role
e manaʻomia ona tuʻuina atu se uiga talafeagai. Mo vaega fa'amau, o le mea lea role="group"
, a'o meafaigaluega e tatau ona i ai se role="toolbar"
.
E le gata i lea, o vaega ma meafaigaluega e tatau ona tuʻuina atu i ai se faʻailoga manino, aua o le tele o tekinolosi fesoasoani o le a le faʻalauiloaina i latou, e ui lava i le i ai o le uiga saʻo o le matafaioi. I faʻataʻitaʻiga o loʻo tuʻuina atu iinei, matou te faʻaaogaina aria-label
, ae o isi mea e pei o le aria-labelledby
mafai foi ona faʻaaogaina.
Fa'amau meafaigaluega
Tu'u fa'atasi seti o vaega fa'amau i fa'amau meafaigaluega mo vaega e sili atu ona lavelave. Fa'aoga vasega aoga pe a mana'omia e va'ava'ai ai vaega, fa'amau, ma isi mea.
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
<button type="button" class="btn btn-secondary">3</button>
<button type="button" class="btn btn-secondary">4</button>
</div>
<div class="btn-group mr-2" role="group" aria-label="Second group">
<button type="button" class="btn btn-secondary">5</button>
<button type="button" class="btn btn-secondary">6</button>
<button type="button" class="btn btn-secondary">7</button>
</div>
<div class="btn-group" role="group" aria-label="Third group">
<button type="button" class="btn btn-secondary">8</button>
</div>
</div>
Lagona le saoloto e fa'afefiloi vaega fa'aoga ma vaega fa'amau i au mea faigaluega. E tutusa ma le faʻataʻitaʻiga o loʻo i luga, atonu e te manaʻomia ni mea aoga e ui ina faʻanofo lelei mea.
<div class="btn-toolbar mb-3" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
<button type="button" class="btn btn-secondary">3</button>
<button type="button" class="btn btn-secondary">4</button>
</div>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text" id="btnGroupAddon">@</div>
</div>
<input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon">
</div>
</div>
<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" role="group" aria-label="First group">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
<button type="button" class="btn btn-secondary">3</button>
<button type="button" class="btn btn-secondary">4</button>
</div>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text" id="btnGroupAddon2">@</div>
</div>
<input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon2">
</div>
</div>
Tele
Nai lo le fa'aogaina o vasega fa'avasega fa'amau i fa'amau ta'itasi i totonu o se kulupu, na'o le fa'aopoopo .btn-group-*
i kulupu ta'itasi .btn-group
, e aofia ai ta'itasi pe a fa'amomoe ni vaega se tele.
<div class="btn-group btn-group-lg" role="group" aria-label="...">...</div>
<div class="btn-group" role="group" aria-label="...">...</div>
<div class="btn-group btn-group-sm" role="group" aria-label="...">...</div>
Faamoega
Tuu se .btn-group
i totonu o le isi .btn-group
pe ae mana'o e fa'afefiloi menus ma se fa'asologa o ki.
<div class="btn-group" role="group" aria-label="Button group with nested dropdown">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Dropdown link</a>
<a class="dropdown-item" href="#">Dropdown link</a>
</div>
</div>
</div>
Fa'asagaga tu'usa'o
Fai se seti o faamau e foliga fa'aputu i luga sa'o nai lo fa'alava. E le lagolagoina i'i le to'alalo o ki lalo.
<div class="btn-group-vertical">
...
</div>