Button Group

To use Button Group, first import SharedModulein your module.

import {SharedModule} from '@gaxon/modules';
@NgModule({
...
imports: [SharedModule, ...],
...
})
export class YourAppModule {
}

Basic Button Group

Preview
HTML
Preview
HTML
<div class="btn-group mr-2 mb-2" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
<div class="btn-group mb-2" role="group" aria-label="Basic example">
<button type="button" class="btn btn-outline-primary">Left</button>
<button type="button" class="btn btn-outline-primary">Middle</button>
<button type="button" class="btn btn-outline-primary">Right</button>
</div>

Vertical Button Group

Preview
HTML
Preview
HTML
<div class="btn-group-vertical mr-2 mb-2" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary">Top</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Bottom</button>
</div>
<div class="btn-group-vertical mb-2" role="group" aria-label="Basic example">
<button type="button" class="btn btn-outline-primary">Top</button>
<button type="button" class="btn btn-outline-primary">Middle</button>
<button type="button" class="btn btn-outline-primary">Bottom</button>
</div>

Toolbar Button Group

Example 1
HTML
Example 1
HTML
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2 mb-2" role="group" aria-label="First group">
<button type="button" class="btn btn-primary">1</button>
<button type="button" class="btn btn-primary">2</button>
<button type="button" class="btn btn-primary">3</button>
<button type="button" class="btn btn-primary">4</button>
</div>
<div class="btn-group mr-2 mb-2" role="group" aria-label="Second group">
<button type="button" class="btn btn-primary">5</button>
<button type="button" class="btn btn-primary">6</button>
<button type="button" class="btn btn-primary">7</button>
</div>
<div class="btn-group mb-2" role="group" aria-label="Third group">
<button type="button" class="btn btn-primary">8</button>
</div>
</div>
Example 2
HTML
Example 2
HTML
<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-outline-primary">1</button>
<button type="button" class="btn btn-outline-primary">2</button>
<button type="button" class="btn btn-outline-primary">3</button>
<button type="button" class="btn btn-outline-primary">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>
Example 3
HTML
Example 3
HTML
<div class="btn-toolbar justify-content-between" role="toolbar">
<div class="btn-group" role="group" aria-label="First group">
<button type="button" class="btn btn-outline-secondary">1</button>
<button type="button" class="btn btn-outline-secondary">2</button>
<button type="button" class="btn btn-outline-secondary">3</button>
<button type="button" class="btn btn-outline-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>

Button Group sizing

Preview
HTML
Preview
HTML
<div>
<div class="btn-group btn-group-lg mr-2 mb-2" role="group">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
</div>
<div>
<div class="btn-group mr-2 mb-2" role="group">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
</div>
<div>
<div class="btn-group btn-group-sm mr-2 mb-2" role="group">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
</div>

Vertical Button Group sizing

Preview
HTML
Preview
HTML
<div class="btn-group-vertical btn-group-lg mr-2 mb-2" role="group">
<button type="button" class="btn btn-outline-primary">Top</button>
<button type="button" class="btn btn-outline-primary">Middle</button>
<button type="button" class="btn btn-outline-primary">Bottom</button>
</div>
<div class="btn-group-vertical mr-2 mb-2" role="group">
<button type="button" class="btn btn-outline-primary">Top</button>
<button type="button" class="btn btn-outline-primary">Middle</button>
<button type="button" class="btn btn-outline-primary">Bottom</button>
</div>
<div class="btn-group-vertical btn-group-sm mb-2" role="group">
<button type="button" class="btn btn-outline-primary">Top</button>
<button type="button" class="btn btn-outline-primary">Middle</button>
<button type="button" class="btn btn-outline-primary">Bottom</button>
</div>

Nesting Button Group

Preview
HTML
Preview
HTML
<div class="btn-group mr-2 mb-2" role="group">
<button type="button" class="btn btn-primary">1</button>
<button type="button" class="btn btn-primary">2</button>
<div class="btn-group" role="group" ngbDropdown>
<button id="btnGroupDrop1" type="button" class="btn btn-primary" ngbDropdownToggle>
Dropdown
</button>
<div ngbDropdownMenu aria-labelledby="btnGroupDrop1">
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
</div>
</div>
</div>

Vertical Nesting Button Group

Preview
Second Tab
Preview
Second Tab
<div class="btn-group-vertical mb-2" role="group">
<button type="button" class="btn btn-outline-secondary">Button</button>
<button type="button" class="btn btn-outline-secondary">Button</button>
<div class="btn-group" role="group" ngbDropdown>
<button id="btnGroupDrop6" type="button" class="btn btn-outline-secondary" ngbDropdownToggle>
Dropdown
</button>
<div ngbDropdownMenu aria-labelledby="btnGroupDrop6">
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
</div>
</div>
<button type="button" class="btn btn-outline-secondary">Button</button>
<button type="button" class="btn btn-outline-secondary">Button</button>
<div class="btn-group" role="group" ngbDropdown>
<button id="btnGroupDrop7" type="button" class="btn btn-outline-secondary" ngbDropdownToggle>
Dropdown
</button>
<div ngbDropdownMenu aria-labelledby="btnGroupDrop7">
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
</div>
</div>
<div class="btn-group" role="group" ngbDropdown>
<button id="btnGroupDrop8" type="button" class="btn btn-outline-secondary" ngbDropdownToggle>
Dropdown
</button>
<div ngbDropdownMenu aria-labelledby="btnGroupDrop8">
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
<a class="dropdown-item" href="javascript:void(0)">Dropdown link</a>
</div>
</div>
</div>