ꯕꯇꯅꯁꯤꯡ ꯌꯥꯑꯣꯔꯤ꯫
ꯃꯁꯤꯡ ꯌꯥꯝꯂꯕꯥ ꯁꯥꯏꯖꯁꯤꯡ, ꯔꯥꯖ꯭ꯌꯁꯤꯡ, ꯑꯃꯁꯨꯡ ꯑꯇꯩ ꯀꯌꯥꯒꯤ ꯁꯄꯣꯔꯠ ꯂꯩꯕꯥ ꯐꯣꯔꯃꯁꯤꯡ, ꯗꯥꯏꯂꯣꯒꯁꯤꯡ, ꯑꯃꯁꯨꯡ ꯑꯇꯩꯗꯥ ꯑꯦꯛꯁꯅꯁꯤꯡꯒꯤꯗꯃꯛꯇꯥ ꯕꯨꯇꯁ꯭ꯠꯔꯥꯄꯀꯤ ꯀꯁ꯭ꯇꯝ ꯕꯇꯟ ꯁ꯭ꯇꯥꯏꯂꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯧ꯫
ꯈꯨꯗꯃꯁꯤꯡ꯫
ꯕꯨꯠꯁ꯭ꯠꯔꯥꯄꯇꯥ ꯃꯃꯥꯡꯗꯥ ꯂꯦꯄꯊꯣꯀꯈ꯭ꯔꯕꯥ ꯕꯇꯟ ꯃꯑꯣꯡ ꯀꯌꯥ ꯑꯃꯥ ꯌꯥꯑꯣꯏ, ꯃꯈꯣꯌ ꯈꯨꯗꯤꯡꯃꯛꯅꯥ ꯃꯁꯥꯒꯤ ꯑꯣꯏꯕꯥ ꯁꯦꯃꯦꯟꯇꯤꯛ ꯄꯥꯟꯗꯝ ꯑꯗꯨ ꯐꯪꯏ, ꯃꯁꯤꯗꯥ ꯑꯍꯦꯅꯕꯥ ꯀꯟꯠꯔꯣꯂꯒꯤꯗꯃꯛꯇꯥ ꯊꯥꯗꯣꯀꯄꯥ ꯑꯍꯦꯅꯕꯥ ꯈꯔꯥ ꯌꯥꯑꯣꯏ꯫
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-light">Light</button>
<button type="button" class="btn btn-dark">Dark</button>
<button type="button" class="btn btn-link">Link</button>
ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡꯗꯥ ꯑꯔꯊ ꯄꯤꯕꯥ꯫
ꯑꯔꯊ ꯍꯥꯄꯆꯤꯟꯅꯕꯥ ꯃꯆꯨ ꯁꯤꯖꯤꯟꯅꯕꯅꯥ ꯚꯤꯖꯨꯑꯦꯜ ꯏꯟꯗꯤꯀꯦꯁꯟ ꯑꯃꯥ ꯈꯛꯇꯃꯛ ꯄꯤꯔꯤ, ꯃꯁꯤ ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯔꯤꯕꯁꯤꯡꯗꯥ – ꯁ꯭ꯛꯔꯤꯟ ꯔꯤꯗꯔꯒꯨꯝꯕꯥ – ꯌꯧꯍꯅꯕꯥ ꯉꯝꯂꯣꯏ꯫ .visually-hidden
ꯃꯆꯨ ꯑꯗꯨꯅꯥ ꯇꯥꯀꯄꯥ ꯏꯅꯐꯣꯔꯃꯦꯁꯟ ꯑꯗꯨ ꯀꯟꯇꯦꯟꯇ ꯃꯁꯥꯃꯛꯇꯒꯤ (ꯈꯨꯗꯝ ꯑꯣꯏꯅꯥ, ꯎꯕꯥ ꯐꯪꯂꯤꯕꯥ ꯇꯦꯛꯁꯠ ꯑꯗꯨꯗꯒꯤ) ꯃꯌꯦꯛ ꯁꯦꯡꯅꯥ ꯎꯕꯥ ꯐꯪꯏ ꯍꯥꯌꯕꯥ ꯁꯣꯌꯗꯅꯥ ꯈꯪꯗꯣꯀꯎ, ꯅꯠꯠꯔꯒꯥ ꯀ꯭ꯂꯥꯁ ꯑꯗꯨꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯂꯣꯠꯁꯤꯜꯂꯕꯥ ꯑꯍꯦꯅꯕꯥ ꯇꯦꯛꯁꯇꯒꯨꯝꯕꯥ ꯑꯂꯇꯔꯅꯦꯇꯤꯚ ꯑꯣꯏꯕꯥ ꯄꯥꯝꯕꯩꯁꯤꯡꯒꯤ ꯈꯨꯠꯊꯥꯡꯗꯥ ꯌꯥꯎꯍꯅꯕꯥ꯫
ꯇꯦꯛꯁꯠ ꯔꯦꯄꯤꯡ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯔꯣ꯫
ꯀꯔꯤꯒꯨꯝꯕꯥ ꯅꯍꯥꯛꯅꯥ ꯕꯇꯟ ꯇꯦꯛꯁꯠ ꯑꯗꯨ ꯔꯦꯞ ꯇꯧꯕꯥ ꯄꯥꯃꯗ꯭ꯔꯕꯗꯤ, ꯅꯍꯥꯛꯅꯥ .text-nowrap
ꯕꯇꯟ ꯑꯗꯨꯗꯥ ꯀ꯭ꯂꯥꯁ ꯑꯗꯨ ꯍꯥꯄꯆꯤꯅꯕꯥ ꯌꯥꯏ꯫ ꯁꯥꯁꯇꯥ, ꯅꯍꯥꯛꯅꯥ $btn-white-space: nowrap
ꯕꯇꯟ ꯈꯨꯗꯤꯡꯃꯛꯀꯤ ꯇꯦꯛꯁꯠ ꯔꯦꯄꯤꯡ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯅꯕꯥ ꯁꯦꯠ ꯇꯧꯕꯥ ꯌꯥꯏ꯫
ꯕꯇꯟ ꯇꯦꯒꯁꯤꯡ꯫
ꯀ꯭ꯂꯥꯁꯁꯤꯡ ꯑꯁꯤ ꯑꯦꯂꯤꯃꯦꯟꯇ .btn
ꯑꯗꯨꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯁꯤꯖꯤꯟꯅꯅꯕꯥ ꯗꯤꯖꯥꯏꯟ ꯇꯧꯕꯅꯤ꯫ <button>
ꯑꯗꯨꯝ ꯑꯣꯏꯅꯃꯛ, ꯅꯍꯥꯛꯅꯥ ꯀ꯭ꯂꯥꯁꯁꯤꯡ ꯑꯁꯤ ꯑꯣꯟ <a>
ꯅꯠꯠꯔꯒꯥ <input>
ꯑꯦꯂꯤꯃꯦꯟꯇꯁꯤꯡꯗꯁꯨ ꯁꯤꯖꯤꯟꯅꯕꯥ ꯌꯥꯏ (ꯕ꯭ꯔꯥꯎꯖꯔ ꯈꯔꯅꯥ ꯈꯔꯥ ꯇꯣꯉꯥꯅꯕꯥ ꯔꯦꯟꯗꯔ ꯑꯃꯥ ꯑꯦꯞꯂꯥꯏ ꯇꯧꯕꯥ ꯌꯥꯏ)꯫
ꯏꯟ-ꯄꯦꯖ ꯐꯉ꯭ꯀꯁꯅꯦꯂꯤꯇꯤ ꯇ꯭ꯔꯤꯒꯔ ꯇꯧꯅꯕꯥ ꯁꯤꯖꯤꯟꯅꯕꯥ ꯑꯦꯂꯤꯃꯦꯟꯇꯁꯤꯡꯗꯥ ꯕꯇꯟ ꯀ꯭ꯂꯥꯁꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯕꯗꯥ <a>
(ꯀꯂꯥꯞꯄꯤꯡ ꯀꯟꯇꯦꯟꯇꯒꯨꯝꯕꯥ), ꯍꯧꯖꯤꯛ ꯂꯩꯔꯤꯕꯥ ꯄꯦꯖ ꯑꯁꯤꯒꯤ ꯃꯅꯨꯡꯗꯥ ꯑꯅꯧꯕꯥ ꯄꯦꯖꯁꯤꯡ ꯅꯠꯠꯔꯒꯥ ꯁꯦꯛꯁꯅꯁꯤꯡꯒꯥ ꯂꯤꯉ꯭ꯛ ꯇꯧꯕꯒꯤ ꯃꯍꯨꯠꯇꯥ, ꯂꯤꯉ꯭ꯀꯁꯤꯡ ꯑꯁꯤꯅꯥ role="button"
ꯃꯈꯣꯌꯒꯤ ꯄꯥꯟꯗꯝ ꯑꯗꯨ ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡꯒꯨꯝꯕꯥ ꯃꯇꯦꯡ ꯄꯥꯡꯅꯕꯥ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡꯗꯥ ꯃꯇꯤꯛ ꯆꯥꯅꯥ ꯌꯧꯍꯟꯅꯕꯥ a ꯄꯤꯒꯗꯕꯅꯤ꯫ ꯁ꯭ꯛꯔꯤꯟ ꯔꯤꯗꯔꯁꯤꯡ ꯌꯥꯑꯣꯔꯤ꯫
<a class="btn btn-primary" href="#" role="button">Link</a>
<button class="btn btn-primary" type="submit">Button</button>
<input class="btn btn-primary" type="button" value="Input">
<input class="btn btn-primary" type="submit" value="Submit">
<input class="btn btn-primary" type="reset" value="Reset">
ꯑꯥꯎꯇꯂꯥꯏꯟ ꯕꯇꯅꯁꯤꯡ꯫
ꯕꯇꯟ ꯑꯃꯥ ꯃꯊꯧ ꯇꯥꯔꯤ, ꯑꯗꯨꯕꯨ ꯃꯈꯣꯌꯅꯥ ꯄꯨꯔꯀꯄꯥ ꯍꯦꯐꯇꯤ ꯕꯦꯀꯒ꯭ꯔꯥꯎꯟꯗ ꯃꯆꯨꯁꯤꯡ ꯑꯗꯨꯗꯤ ꯅꯠꯇꯦ? .btn-outline-*
ꯕꯇꯟ ꯑꯃꯍꯦꯛꯇꯗꯥ ꯂꯩꯕꯥ ꯕꯦꯀꯒ꯭ꯔꯥꯎꯟꯗ ꯏꯃꯦꯖ ꯑꯃꯁꯨꯡ ꯃꯆꯨ ꯄꯨꯝꯅꯃꯛ ꯂꯧꯊꯣꯛꯅꯕꯥ ꯗꯤꯐꯣꯜꯇ ꯃꯣꯗꯤꯐꯥꯏꯌꯔ ꯀ꯭ꯂꯥꯁꯁꯤꯡ ꯑꯗꯨꯒꯥ ꯃꯍꯨꯠ ꯁꯤꯜꯂꯨ꯫
<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-danger">Danger</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-light">Light</button>
<button type="button" class="btn btn-outline-dark">Dark</button>
ꯁꯥꯏꯖꯁꯤꯡ꯫
ꯐꯦꯟꯁꯤ ꯑꯆꯧꯕꯥ ꯅꯠꯠꯔꯒꯥ ꯑꯄꯤꯀꯄꯥ ꯕꯇꯅꯁꯤꯡ? ꯑꯍꯦꯅꯕꯥ ꯁꯥꯏꯖꯁꯤꯡꯒꯤꯗꯃꯛꯇꯥ .btn-lg
ꯅꯠꯠꯔꯒꯥ ꯍꯥꯄꯆꯤꯜꯂꯨ꯫.btn-sm
<button type="button" class="btn btn-primary btn-lg">Large button</button>
<button type="button" class="btn btn-secondary btn-lg">Large button</button>
<button type="button" class="btn btn-primary btn-sm">Small button</button>
<button type="button" class="btn btn-secondary btn-sm">Small button</button>
ꯗꯤꯁꯑꯦꯕꯜ ꯑꯣꯏꯔꯕꯥ ꯁ꯭ꯇꯦꯠ꯫
ꯑꯦꯂꯤꯃꯦꯟꯇ disabled
ꯑꯃꯍꯦꯛꯇꯗꯥ ꯕꯨꯂꯦꯟ ꯑꯦꯠꯔꯤꯕꯤꯎꯠ ꯍꯥꯄꯆꯤꯟꯗꯨꯅꯥ ꯕꯇꯅꯁꯤꯡ ꯑꯁꯤ ꯏꯅꯑꯦꯛꯇꯤꯕ ꯑꯣꯏꯅꯥ ꯎꯍꯅꯒꯗꯕꯅꯤ꯫ <button>
ꯗꯤꯁꯦꯕꯜ ꯇꯧꯔꯕꯥ ꯕꯇꯅꯁꯤꯡꯅꯥ pointer-events: none
ꯑꯦꯞꯂꯥꯏ ꯇꯧꯈ꯭ꯔꯦ, ꯃꯁꯤꯅꯥ ꯍꯣꯚꯔ ꯑꯃꯁꯨꯡ ꯑꯦꯛꯇꯤꯕ ꯁ꯭ꯇꯦꯠꯁꯤꯡ ꯇ꯭ꯔꯤꯒꯔ ꯇꯧꯕꯥ ꯊꯤꯡꯏ꯫
<button type="button" class="btn btn-lg btn-primary" disabled>Primary button</button>
<button type="button" class="btn btn-secondary btn-lg" disabled>Button</button>
ꯑꯦꯂꯤꯃꯦꯟꯇ ꯁꯤꯖꯤꯟꯅꯗꯨꯅꯥ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯔꯕꯥ ꯕꯇꯅꯁꯤꯡꯅꯥ <a>
ꯈꯔꯥ ꯇꯣꯉꯥꯅꯕꯥ ꯃꯑꯣꯡꯗꯥ ꯂꯃꯆꯠ ꯁꯥꯖꯠ ꯆꯠꯂꯤ:
<a>
sꯅꯥ ꯑꯦꯠꯔꯤꯕꯤꯎꯠ ꯑꯗꯨ ꯁꯄꯣꯔꯠ ꯇꯧꯗꯦ , ꯃꯔꯝ ꯑꯗꯨꯅꯥ ꯅꯍꯥꯛꯅꯥ ꯀ꯭ꯂꯥꯁ ꯑꯗꯨ ꯚꯤꯖꯨꯑꯦꯜ ꯑꯣꯏꯅꯥ ꯗꯤꯁꯦꯕꯜ ꯑꯣꯏꯅꯥ ꯎꯕꯥ ꯐꯪꯍꯟꯅꯕꯥdisabled
ꯍꯥꯄꯆꯤꯅꯒꯗꯕꯅꯤ꯫.disabled
pointer-events
ꯑꯦꯉ꯭ꯀꯔ ꯕꯇꯅꯁꯤꯡꯗꯥ ꯄꯨꯝꯅꯃꯛ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯅꯕꯥ ꯇꯨꯡꯒꯤ ꯑꯣꯏꯕꯥ ꯃꯑꯣꯡ ꯈꯔꯗꯤ ꯌꯥꯑꯣꯔꯤ꯫aria-disabled="true"
ꯗꯤꯁꯑꯦꯕꯜ ꯑꯣꯏꯔꯕꯥ ꯕꯇꯅꯁꯤꯡꯗꯥ ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡꯗꯥ ꯑꯦꯂꯤꯃꯦꯟꯇ ꯑꯗꯨꯒꯤ ꯐꯤꯚꯝ ꯑꯗꯨ ꯇꯥꯛꯅꯕꯥ ꯑꯦꯠꯔꯤꯕꯤꯎꯠ ꯑꯗꯨ ꯌꯥꯎꯒꯗꯕꯅꯤ꯫
<a href="#" class="btn btn-primary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a>
<a href="#" class="btn btn-secondary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a>
ꯂꯤꯉ꯭ꯛ ꯐꯉ꯭ꯀꯁꯅꯦꯂꯤꯇꯤ ꯀꯦꯚꯦꯠ ꯇꯧꯕꯥ꯫
.disabled
ꯀ꯭ꯂꯥꯁ ꯑꯁꯤꯅꯥ sꯒꯤ ꯂꯤꯉ꯭ꯛ ꯐꯉ꯭ꯀꯁꯅꯦꯂꯤꯇꯤ ꯑꯁꯤ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯅꯕꯥ ꯍꯣꯠꯅꯕꯗꯥ ꯁꯤꯖꯤꯟꯅꯩ , pointer-events: none
ꯑꯗꯨꯕꯨ <a>
CSS ꯄ꯭ꯔꯣꯄꯔꯇꯤ ꯑꯗꯨ ꯍꯧꯖꯤꯛ ꯐꯥꯑꯣꯕꯥ ꯁ꯭ꯇꯦꯟꯗꯔꯗꯥꯏꯖ ꯇꯧꯗ꯭ꯔꯤ꯫ ꯃꯁꯤꯒꯤ ꯃꯊꯛꯇꯥ, ꯁꯄꯣꯔꯠ ꯇꯧꯔꯤꯕꯥ ꯕ꯭ꯔꯥꯎꯖꯔꯁꯤꯡꯗꯁꯨ pointer-events: none
, ꯀꯤꯕꯣꯔꯗ ꯅꯦꯚꯤꯒꯦꯁꯟ ꯑꯁꯤ ꯁꯣꯀꯍꯟꯗꯅꯥ ꯂꯩꯔꯤ, ꯃꯁꯤꯅꯥ ꯇꯥꯀꯄꯗꯤ ꯃꯤꯠ ꯎꯗꯕꯥ ꯀꯤꯕꯣꯔꯗ ꯁꯤꯖꯤꯟꯅꯔꯤꯕꯁꯤꯡ ꯑꯃꯁꯨꯡ ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯔꯤꯕꯁꯤꯡꯅꯥ ꯍꯧꯖꯤꯀꯁꯨ ꯂꯤꯉ꯭ꯀꯁꯤꯡ ꯑꯁꯤ ꯑꯦꯛꯇꯤꯕ ꯑꯣꯏꯍꯅꯕꯥ ꯉꯃꯒꯅꯤ꯫ ꯑꯗꯨꯅꯥ ꯁꯦꯐ ꯑꯣꯏꯅꯕꯒꯤꯗꯃꯛ, ꯒꯤ ꯃꯊꯛꯇꯥ aria-disabled="true"
, ꯂꯤꯉ꯭ꯀꯁꯤꯡ ꯑꯁꯤꯗꯥ ꯑꯦꯠꯔꯤꯕꯤꯎꯠ ꯑꯃꯁꯨ ꯌꯥꯑꯣꯍꯅꯕꯤꯌꯨ tabindex="-1"
ꯃꯗꯨꯅꯥ ꯃꯈꯣꯌꯅꯥ ꯀꯤꯕꯣꯔꯗ ꯐꯣꯀꯁ ꯐꯪꯍꯟꯗꯅꯕꯥ, ꯑꯃꯁꯨꯡ ꯃꯈꯣꯌꯒꯤ ꯐꯉ꯭ꯀꯁꯅꯦꯂꯤꯇꯤ ꯑꯗꯨ ꯃꯄꯨꯡ ꯐꯥꯅꯥ ꯗꯤꯁꯦꯕꯜ ꯇꯧꯅꯕꯥ ꯀꯁ꯭ꯇꯝ ꯖꯥꯚꯥꯁ꯭ꯛꯔꯤꯞꯇ ꯁꯤꯖꯤꯟꯅꯧ꯫
ꯕ꯭ꯂꯣꯛ ꯇꯧꯕꯥ ꯕꯣꯇꯅꯁꯤꯡ꯫
ꯑꯩꯈꯣꯌꯒꯤ ꯗꯤꯁꯞꯂꯦ ꯑꯃꯁꯨꯡ ꯒꯦꯞ ꯌꯨꯇꯤꯂꯤꯇꯤꯁꯤꯡꯒꯤ ꯃꯤꯛꯁ ꯑꯃꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯕꯨꯠꯁ꯭ꯠꯔꯥꯞ ꯴ꯗꯥ ꯂꯩꯔꯤꯕꯥ ꯑꯁꯤꯒꯨꯝꯕꯥ ꯃꯄꯨꯡ ꯐꯥꯕꯥ, “ꯕ꯭ꯂꯣꯛ ꯕꯇꯟ”ꯁꯤꯡꯒꯤ ꯔꯦꯁ꯭ꯄꯣꯟꯁꯤꯕꯜ ꯁ꯭ꯇꯦꯀꯁꯤꯡ ꯁꯦꯝꯃꯨ꯫ ꯕꯇꯟ ꯁ꯭ꯄꯦꯁꯤꯐꯤꯛ ꯀ꯭ꯂꯥꯁꯁꯤꯡꯒꯤ ꯃꯍꯨꯠꯇꯥ ꯌꯨꯇꯤꯂꯤꯇꯤꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯗꯨꯅꯥ ꯑꯩꯈꯣꯌꯅꯥ ꯁ꯭ꯄꯦꯁꯤꯡ, ꯑꯦꯂꯥꯏꯟꯃꯦꯟꯇ, ꯑꯃꯁꯨꯡ ꯔꯦꯁ꯭ꯄꯣꯟꯁꯤꯕꯜ ꯕꯤꯍꯦꯕꯤꯌꯔꯁꯤꯡꯒꯤ ꯃꯇꯥꯡꯗꯥ ꯌꯥꯝꯅꯥ ꯍꯦꯟꯅꯥ ꯀꯟꯠꯔꯣꯜ ꯂꯩ꯫
<div class="d-grid gap-2">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>
md
ꯃꯐꯝ ꯑꯁꯤꯗꯥ ꯑꯩꯈꯣꯌꯅꯥ ꯔꯦꯁ꯭ꯄꯣꯟꯁꯤꯕ ꯚꯦꯔꯤꯑꯦꯁꯟ ꯑꯃꯥ ꯁꯦꯝꯃꯤ, ꯕ꯭ꯔꯦꯀꯄꯣꯏꯟꯇ ꯐꯥꯑꯣꯕꯥ ꯚꯔꯇꯤꯀꯦꯜ ꯑꯣꯏꯅꯥ ꯁ꯭ꯇꯦꯛ ꯇꯧꯔꯕꯥ ꯕꯇꯅꯁꯤꯡꯗꯒꯤ ꯍꯧꯔꯒꯥ , ꯃꯐꯝ .d-md-block
ꯑꯗꯨꯗꯥ ꯀ꯭ꯂꯥꯁ ꯑꯗꯨ ꯃꯍꯨꯠ ꯁꯤꯜꯂꯤ .d-grid
, ꯃꯗꯨꯅꯥ gap-2
ꯌꯨꯇꯤꯂꯤꯇꯤ ꯑꯗꯨ ꯅ꯭ꯌꯨꯂꯤꯐꯥꯏ ꯇꯧꯏ꯫ ꯃꯈꯣꯌ ꯍꯣꯡꯂꯀꯄꯥ ꯎꯅꯕꯒꯤꯗꯃꯛ ꯅꯍꯥꯛꯀꯤ ꯕ꯭ꯔꯥꯎꯖꯔꯒꯤ ꯁꯥꯏꯖ ꯑꯗꯨ ꯍꯣꯡꯗꯣꯀꯎ꯫
<div class="d-grid gap-2 d-md-block">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>
ꯅꯍꯥꯛꯅꯥ ꯅꯍꯥꯛꯀꯤ ꯕ꯭ꯂꯣꯛ ꯕꯇꯅꯁꯤꯡꯒꯤ ꯄꯥꯛ ꯆꯥꯎꯕꯥ ꯑꯗꯨ ꯒ꯭ꯔꯤꯗ ꯀꯣꯂꯃꯒꯤ ꯄꯥꯛ ꯆꯥꯎꯕꯥ ꯀ꯭ꯂꯥꯁꯁꯤꯡꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯑꯦꯗꯖꯁ꯭ꯠ ꯇꯧꯕꯥ ꯌꯥꯏ꯫ ꯈꯨꯗꯝ ꯑꯣꯏꯅꯥ, ꯍꯥꯐ-ꯋꯥꯏꯗ “ꯕ꯭ꯂꯣꯛ ꯕꯇꯟ” ꯑꯃꯒꯤꯗꯃꯛ, .col-6
. ꯃꯁꯤꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯍꯣꯔꯥꯏꯖꯣꯟꯇꯦꯜ ꯑꯣꯏꯅꯥ ꯁꯦꯟꯇꯔ ꯇꯧꯕꯤꯌꯨ .mx-auto
, ꯁꯨ꯫
<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>
ꯍꯣꯔꯥꯏꯖꯣꯟꯇꯦꯜ ꯑꯣꯏꯕꯥ ꯃꯇꯃꯗꯥ ꯕꯇꯅꯁꯤꯡꯒꯤ ꯑꯦꯂꯥꯏꯟꯃꯦꯟꯇ ꯑꯗꯨ ꯑꯦꯗꯖꯁ꯭ꯠ ꯇꯧꯅꯕꯥ ꯑꯍꯦꯅꯕꯥ ꯌꯨꯇꯤꯂꯤꯇꯤꯁꯤꯡ ꯁꯤꯖꯤꯟꯅꯕꯥ ꯌꯥꯏ꯫ ꯃꯐꯝ ꯑꯁꯤꯗꯥ ꯑꯩꯈꯣꯌꯅꯥ ꯑꯩꯈꯣꯌꯒꯤ ꯃꯃꯥꯡꯒꯤ ꯔꯦꯁ꯭ꯄꯣꯟꯁꯤꯕ ꯈꯨꯗꯝ ꯑꯃꯥ ꯂꯧꯈ꯭ꯔꯦ ꯑꯃꯁꯨꯡ ꯐ꯭ꯂꯦꯛꯁ ꯌꯨꯇꯤꯂꯤꯇꯤ ꯈꯔꯥ ꯑꯃꯁꯨꯡ ꯕꯇꯟ ꯑꯗꯨꯗꯥ ꯃꯥꯔꯖꯤꯟ ꯌꯨꯇꯤꯂꯤꯇꯤ ꯑꯃꯥ ꯍꯥꯄꯆꯤꯜꯂꯦ ꯃꯗꯨꯅꯥ ꯕꯇꯅꯁꯤꯡ ꯑꯗꯨ ꯃꯈꯥ ꯇꯥꯅꯥ ꯁ꯭ꯇꯦꯛ ꯇꯧꯗ꯭ꯔꯤꯉꯩꯗꯥ ꯔꯥꯏꯠ ꯑꯦꯂꯥꯏꯟ ꯇꯧꯔꯦ꯫
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button class="btn btn-primary me-md-2" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>
ꯕꯇꯟ ꯄ꯭ꯂꯒꯏꯟ ꯇꯧꯕꯥ꯫
ꯕꯇꯟ ꯄ꯭ꯂꯒꯏꯟ ꯑꯁꯤꯅꯥ ꯅꯍꯥꯀꯄꯨ ꯏꯆꯝ ꯆꯝꯕꯥ ꯑꯣꯟ/ꯑꯣꯐ ꯇꯣꯒꯜ ꯕꯇꯅꯁꯤꯡ ꯁꯦꯝꯕꯥ ꯌꯥꯍꯜꯂꯤ꯫
ꯔꯥꯖ꯭ꯌꯁꯤꯡ ꯇꯣꯒꯜ ꯇꯧꯕꯥ꯫
data-bs-toggle="button"
ꯕꯇꯟ ꯑꯃꯒꯤ active
ꯁ꯭ꯇꯦꯠ ꯇꯣꯒꯜ ꯇꯧꯅꯕꯥ ꯍꯥꯄꯆꯤꯜꯂꯨ꯫ ꯀꯔꯤꯒꯨꯝꯕꯥ ꯅꯍꯥꯛꯅꯥ ꯕꯇꯟ ꯑꯃꯥ ꯄ꯭ꯔꯤ-ꯇꯣꯒꯜ ꯇꯧꯔꯕꯗꯤ, ꯅꯍꯥꯛꯅꯥ .active
ꯀ꯭ꯂꯥꯁ ꯑꯗꯨ ꯃꯦꯅꯨꯑꯦꯜ ꯑꯣꯏꯅꯥ ꯍꯥꯄꯀꯗꯕꯅꯤ ꯑꯃꯁꯨꯡ aria-pressed="true"
ꯃꯁꯤ ꯑꯦꯁꯤꯁ꯭ꯇꯦꯟꯇ ꯇꯦꯛꯅꯣꯂꯣꯖꯤꯁꯤꯡꯗꯥ ꯃꯇꯤꯛ ꯆꯥꯅꯥ ꯌꯧꯍꯅꯕꯥ ꯉꯝꯅꯕꯥ꯫
<button type="button" class="btn btn-primary" data-bs-toggle="button" autocomplete="off">Toggle button</button>
<button type="button" class="btn btn-primary active" data-bs-toggle="button" autocomplete="off" aria-pressed="true">Active toggle button</button>
<button type="button" class="btn btn-primary" disabled data-bs-toggle="button" autocomplete="off">Disabled toggle button</button>
<a href="#" class="btn btn-primary" role="button" data-bs-toggle="button">Toggle link</a>
<a href="#" class="btn btn-primary active" role="button" data-bs-toggle="button" aria-pressed="true">Active toggle link</a>
<a href="#" class="btn btn-primary disabled" tabindex="-1" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a>
ꯄꯥꯝꯕꯩꯁꯤꯡ꯫
ꯕꯇꯟ ꯀꯟꯁꯠꯔꯛꯁꯅꯒꯥ ꯂꯣꯌꯅꯅꯥ ꯅꯍꯥꯛꯅꯥ ꯕꯇꯟ ꯏꯟꯁꯇꯦꯟꯁ ꯑꯃꯥ ꯁꯦꯝꯕꯥ ꯌꯥꯏ, ꯈꯨꯗꯝ ꯑꯣꯏꯅꯥ:
var button = document.getElementById('myButton')
var bsButton = new bootstrap.Button(button)
ꯊꯧꯑꯪꯡ | ꯋꯥꯔꯣꯜ |
---|---|
toggle |
ꯄꯨꯁ ꯁ꯭ꯇꯦꯠ ꯇꯣꯒꯜ ꯇꯧꯏ꯫ ꯕꯇꯟ ꯑꯗꯨꯗꯥ ꯃꯁꯤ ꯑꯦꯛꯇꯤꯕ ꯑꯣꯏꯔꯦ ꯍꯥꯌꯕꯒꯤ ꯃꯑꯣꯡ ꯑꯗꯨ ꯄꯤꯔꯤ꯫ |
dispose |
ꯑꯦꯂꯤꯃꯦꯟꯇ ꯑꯃꯒꯤ ꯕꯇꯟ ꯑꯃꯥ ꯃꯥꯡꯍꯜꯂꯤ꯫ (ꯗꯤ.ꯑꯣ.ꯑꯦꯝ.ꯒꯤ ꯑꯦꯂꯤꯃꯦꯟꯇꯇꯥ ꯊꯝꯂꯤꯕꯥ ꯗꯦꯇꯥ ꯑꯗꯨ ꯂꯧꯊꯣꯀꯏ) |
getInstance |
DOM ꯑꯦꯂꯤꯃꯦꯟꯇ ꯑꯃꯒꯥ ꯃꯔꯤ ꯂꯩꯅꯕꯥ ꯕꯇꯟ ꯏꯟꯁꯇꯦꯟꯁ ꯑꯗꯨ ꯐꯪꯍꯅꯕꯥ ꯌꯥꯕꯥ ꯁ꯭ꯇꯦꯇꯤꯛ ꯃꯦꯊꯗ, ꯅꯍꯥꯛꯅꯥ ꯃꯁꯤ ꯑꯁꯤꯒꯨꯝꯅꯥ ꯁꯤꯖꯤꯟꯅꯕꯥ ꯌꯥꯏ:bootstrap.Button.getInstance(element) |
getOrCreateInstance |
DOM ꯑꯦꯂꯤꯃꯦꯟꯇ ꯑꯃꯒꯥ ꯃꯔꯤ ꯂꯩꯅꯕꯥ ꯕꯇꯟ ꯏꯟꯁꯇꯦꯟꯁ ꯑꯃꯥ ꯔꯤꯇꯔꯟ ꯇꯧꯕꯥ ꯅꯠꯠꯔꯒꯥ ꯃꯁꯤ ꯏꯅꯤꯁꯤꯑꯦꯂꯥꯏꯖ ꯇꯧꯈꯤꯗꯕꯥ ꯑꯣꯏꯔꯕꯗꯤ ꯑꯅꯧꯕꯥ ꯑꯃꯥ ꯁꯦꯝꯕꯥ ꯁ꯭ꯇꯦꯇꯤꯛ ꯃꯦꯊꯗ꯫ ꯅꯍꯥꯛꯅꯥ ꯃꯁꯤ ꯃꯈꯥꯒꯤ ꯑꯁꯤꯒꯨꯝꯅꯥ ꯁꯤꯖꯤꯟꯅꯕꯥ ꯌꯥꯏ:bootstrap.Button.getOrCreateInstance(element) |
ꯈꯨꯗꯝ ꯑꯣꯏꯅꯥ, ꯕꯇꯟ ꯄꯨꯝꯅꯃꯛ ꯇꯣꯒꯜ ꯇꯧꯅꯕꯥ꯫
var buttons = document.querySelectorAll('.btn')
buttons.forEach(function (button) {
var button = new bootstrap.Button(button)
button.toggle()
})
ꯁꯥꯁꯁ ꯇꯧꯕꯥ꯫
ꯚꯦꯔꯤꯑꯦꯕꯂꯁꯤꯡ꯫
$btn-padding-y: $input-btn-padding-y;
$btn-padding-x: $input-btn-padding-x;
$btn-font-family: $input-btn-font-family;
$btn-font-size: $input-btn-font-size;
$btn-line-height: $input-btn-line-height;
$btn-white-space: null; // Set to `nowrap` to prevent text wrapping
$btn-padding-y-sm: $input-btn-padding-y-sm;
$btn-padding-x-sm: $input-btn-padding-x-sm;
$btn-font-size-sm: $input-btn-font-size-sm;
$btn-padding-y-lg: $input-btn-padding-y-lg;
$btn-padding-x-lg: $input-btn-padding-x-lg;
$btn-font-size-lg: $input-btn-font-size-lg;
$btn-border-width: $input-btn-border-width;
$btn-font-weight: $font-weight-normal;
$btn-box-shadow: inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075);
$btn-focus-width: $input-btn-focus-width;
$btn-focus-box-shadow: $input-btn-focus-box-shadow;
$btn-disabled-opacity: .65;
$btn-active-box-shadow: inset 0 3px 5px rgba($black, .125);
$btn-link-color: $link-color;
$btn-link-hover-color: $link-hover-color;
$btn-link-disabled-color: $gray-600;
// Allows for customizing button radius independently from global border radius
$btn-border-radius: $border-radius;
$btn-border-radius-sm: $border-radius-sm;
$btn-border-radius-lg: $border-radius-lg;
$btn-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
$btn-hover-bg-shade-amount: 15%;
$btn-hover-bg-tint-amount: 15%;
$btn-hover-border-shade-amount: 20%;
$btn-hover-border-tint-amount: 10%;
$btn-active-bg-shade-amount: 20%;
$btn-active-bg-tint-amount: 20%;
$btn-active-border-shade-amount: 25%;
$btn-active-border-tint-amount: 10%;
ꯃꯤꯛꯁꯅꯁꯤꯡ꯫
ꯕꯇꯅꯁꯤꯡꯒꯤꯗꯃꯛꯇꯥ ꯃꯤꯛꯁꯤꯟ ꯑꯍꯨꯝ ꯂꯩ: ꯕꯇꯟ ꯑꯃꯁꯨꯡ ꯕꯇꯟ ꯑꯥꯎꯇꯂꯥꯏꯟ ꯚꯦꯔꯤꯑꯦꯟꯇ ꯃꯤꯛꯁꯤꯟ (ꯑꯅꯤꯃꯛ ꯗꯥ ꯌꯨꯝꯐꯝ ꯑꯣꯏꯕꯥ $theme-colors
), ꯄ꯭ꯂꯥꯁ ꯕꯇꯟ ꯁꯥꯏꯖ ꯃꯤꯛꯁꯤꯟ ꯑꯃꯥ꯫
@mixin button-variant(
$background,
$border,
$color: color-contrast($background),
$hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
$hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
$hover-color: color-contrast($hover-background),
$active-background: if($color == $color-contrast-light, shade-color($background, $btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
$active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
$active-color: color-contrast($active-background),
$disabled-background: $background,
$disabled-border: $border,
$disabled-color: color-contrast($disabled-background)
) {
color: $color;
@include gradient-bg($background);
border-color: $border;
@include box-shadow($btn-box-shadow);
&:hover {
color: $hover-color;
@include gradient-bg($hover-background);
border-color: $hover-border;
}
.btn-check:focus + &,
&:focus {
color: $hover-color;
@include gradient-bg($hover-background);
border-color: $hover-border;
@if $enable-shadows {
@include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
} @else {
// Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
}
}
.btn-check:checked + &,
.btn-check:active + &,
&:active,
&.active,
.show > &.dropdown-toggle {
color: $active-color;
background-color: $active-background;
// Remove CSS gradients if they're enabled
background-image: if($enable-gradients, none, null);
border-color: $active-border;
&:focus {
@if $enable-shadows {
@include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
} @else {
// Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
}
}
}
&:disabled,
&.disabled {
color: $disabled-color;
background-color: $disabled-background;
// Remove CSS gradients if they're enabled
background-image: if($enable-gradients, none, null);
border-color: $disabled-border;
}
}
@mixin button-outline-variant(
$color,
$color-hover: color-contrast($color),
$active-background: $color,
$active-border: $color,
$active-color: color-contrast($active-background)
) {
color: $color;
border-color: $color;
&:hover {
color: $color-hover;
background-color: $active-background;
border-color: $active-border;
}
.btn-check:focus + &,
&:focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
.btn-check:checked + &,
.btn-check:active + &,
&:active,
&.active,
&.dropdown-toggle.show {
color: $active-color;
background-color: $active-background;
border-color: $active-border;
&:focus {
@if $enable-shadows {
@include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
} @else {
// Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
}
}
&:disabled,
&.disabled {
color: $color;
background-color: transparent;
}
}
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
padding: $padding-y $padding-x;
@include font-size($font-size);
// Manually declare to provide an override to the browser default
@include border-radius($border-radius, 0);
}
ꯂꯨꯄꯁꯤꯡ꯫
ꯕꯇꯟ ꯚꯦꯔꯤꯑꯦꯟꯇꯁꯤꯡ (ꯔꯦꯒꯨꯂꯥꯔ ꯑꯃꯁꯨꯡ ꯑꯥꯎꯠꯂꯥꯏꯟ ꯕꯇꯅꯁꯤꯡꯒꯤ ꯑꯣꯏꯅꯥ)ꯅꯥ ꯃꯈꯣꯌꯒꯤ ꯃꯁꯥꯒꯤ ꯑꯣꯏꯕꯥ ꯃꯤꯛꯁꯤꯅꯁꯤꯡ ꯑꯁꯤ ꯑꯩꯈꯣꯌꯒꯤ $theme-colors
ꯃꯦꯄꯀꯥ ꯂꯣꯌꯅꯅꯥ ꯁꯤꯖꯤꯟꯅꯗꯨꯅꯥ ꯃꯣꯗꯤꯐꯥꯏꯌꯔ ꯀ꯭ꯂꯥꯁꯁꯤꯡ ꯑꯁꯤ scss/_buttons.scss
.
@each $color, $value in $theme-colors {
.btn-#{$color} {
@include button-variant($value, $value);
}
}
@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
}
}