Source

Button group a ni

Button hrang hrangte chu button group nen line khatah group khawm la, JavaScript hmangin super-power rawh.

Entirna bulpui ber

Button series pakhat chu in hmangin wrap .btnrawh .btn-group. Kan buttons plugin hmangin JavaScript radio leh checkbox style behavior optional te chu add rawh .

<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>
Dik taka enfiah la role, label pe rawh

Assistive technology (screen reader ang chi) te’n button hrang hrang group a rolenih thu an sawi theih nan attribute dik tak pek a ngai a ni. Button group tan chuan hei hi , a ni ang a role="group", toolbar-ah erawh chuan role="toolbar".

Chu bakah, group leh toolbar-te chu chiang taka label pek tur a ni a, a chhan chu assistive technology tam zawk chuan chutiang a nih loh chuan an puang dawn lo a, role attribute dik tak awm chung pawhin. Heta entîrna kan pêkteah hian , kan hmang aria-labela, mahse a dangte aria-labelledbypawh hman theih a ni.

Button hmangin hmanrua a awm

Button group set hrang hrangte chu button toolbar-ah dahkhawm la, component complex zawkte tan. Group, button leh a dangte space out turin a tul angin utility class hmang ang che.

<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>

I toolbar-a input group leh button group te chu zalen takin mix la. A chunga entir ang bawkin, thil space tha tur chuan utility thenkhat i mamawh mai thei.

<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>

Sizing a ni

Group pakhata button tinteah button sizing class apply ai chuan, group tam tak nest hunah pakhat zel pawh telh, .btn-group-*each -ah add mai rawh..btn-group



<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>

Nesting tih a ni

Dropdown menus button series nena mix i duh hunah a .btn-groupdang chhungah dah rawh ..btn-group

<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 id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      Dropdown
    </button>
    <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
      <a class="dropdown-item" href="#">Dropdown link</a>
      <a class="dropdown-item" href="#">Dropdown link</a>
    </div>
  </div>
</div>

Vertical atanga inthlak danglamna

Button set pakhat chu horizontal-a awm lovin vertical-a stack-a lang turin siam rawh. Hetah hian split button dropdown hi a support lo.

<div class="btn-group-vertical">
  ...
</div>