入力要素(input , textarea , etc.)の前後にテキスト、ボタンなどの補助機能を配置するための拡張用コンポーネント。
div.input-group
div.input-group-prepend
span.input-group-text 属性
id="basic-addon1"@input.form-control 属性
type="text"placeholder="Username"aria-label="Username"aria-describedby="basic-addon1"(公式ドキュメントより)使用上のガイドラインは次の通り。
label はインプットグループの外部に用いる
input.form-control : 設定は前置と同様(略)div.input-group-append
label の使用例label はインプットグループの外部(それを指し示す位置)に用いる 属性
for="basic-url" (インプットグループ内の input のIDと同じ)Your vanity URLtextarea の使用例textarea.form-controlグループ外枠に .input-group-(sm|lg) を追加する。
div.input-group.input-group-sm
div.input-group
div.input-group.input-group-lg
チェックボックス
ラジオボタン
div.input-group-prepend
div.input-group-text (背景塗りつぶし用)
input.form-control (×2) (3以上も可、等分配置)この構成は入力コントロールは1つだけという規則に従っていないため、Bootstrap 4方式バリデーションで問題を生じる。ただし不正(invalid)時に共通のメッセージを表示するという仕様であれば矛盾は生じない。次の設定例を参照。
.was-validated を追加input.form-control (×2) 属性
required を追加div.invalid-response
Please input your namediv.input-group-append
div.input-group-prepend
button.btn.btn-outline-secondary 属性
.dropdown-toggletype="button"data-toggle="dropdown"aria-haspopup="true"aria-expanded="false"Dropdowndiv.dropdown-menu
div.input-group-append
div.input-group-prepend
button.btn.btn-outline-secondary 属性
type="button"Actionbutton.btn.btn-outline-secondary 属性
.dropdown-toggle.dropdown-toggle-splittype="button"data-toggle="dropdown"aria-haspopup="true"aria-expanded="false"span.sr-only
Toggle Dropdowndiv.dropdown-menu
div.input-group-append
カスタムフォームコントロールを用いた応用例。
select
label.input-group-text 属性
for="inputGroupSelect1"Optionsselect.custom-select 属性
id="inputGroupSelect1"option ... (×4)div.custom-file
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
It uses utility classes for typography and spacing to space content out within the larger container.
div.jumbotron
h1.display-4
Hello, world!p.lead
This is a simple hero unit, ...hr.my-4p
It uses utility classes ...p.lead
a.btn.btn-primary.btn-lg 属性
href="#"role="button"Learn moreThis is a modified jumbotron that occupies the entire horizontal space of its parent.
横幅いっぱいに(角を丸めず)配置する場合は .jumbotron-fluid を使い、その中に div.container 以下を入れる。
body (親がいるとその内側100%に配置する)
div.jumbotron.jumbotron-fluid
div.container
h1.display-4
Fluid jumbotronp
This is a modified jumbotron ...