button.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. ---
  2. title: Button
  3. layout: documentation
  4. doc-tab: elements
  5. doc-subtab: button
  6. breadcrumb:
  7. - home
  8. - documentation
  9. - elements
  10. - elements-button
  11. meta:
  12. colors: true
  13. sizes: true
  14. variables: true
  15. ---
  16. {% capture button_example %}
  17. <a class="button">Button</a>
  18. {% endcapture %}
  19. {% capture button_tags_example %}
  20. <a class="button">Anchor</a>
  21. <button class="button">Button</button>
  22. <input class="button" type="submit" value="Submit input">
  23. <input class="button" type="reset" value="Reset input">
  24. {% endcapture %}
  25. {% capture button_colors_a_example %}
  26. <a class="button is-white">White</a>
  27. <a class="button is-light">Light</a>
  28. <a class="button is-dark">Dark</a>
  29. <a class="button is-black">Black</a>
  30. <a class="button is-text">Text</a>
  31. {% endcapture %}
  32. {% capture button_colors_b_example %}
  33. <a class="button is-primary">Primary</a>
  34. <a class="button is-link">Link</a>
  35. <a class="button is-info">Info</a>
  36. <a class="button is-success">Success</a>
  37. <a class="button is-warning">Warning</a>
  38. <a class="button is-danger">Danger</a>
  39. {% endcapture %}
  40. {% capture button_sizes_example %}
  41. <a class="button is-small">Small</a>
  42. <a class="button">Normal</a>
  43. <a class="button is-medium">Medium</a>
  44. <a class="button is-large">Large</a>
  45. {% endcapture %}
  46. {% capture button_outlined_example %}
  47. <a class="button is-outlined">Outlined</a>
  48. <a class="button is-primary is-outlined">Outlined</a>
  49. <a class="button is-link is-outlined">Outlined</a>
  50. <a class="button is-info is-outlined">Outlined</a>
  51. <a class="button is-success is-outlined">Outlined</a>
  52. <a class="button is-danger is-outlined">Outlined</a>
  53. {% endcapture %}
  54. {% capture button_inverted_example %}
  55. <a class="button is-primary is-inverted">Inverted</a>
  56. <a class="button is-link is-inverted">Inverted</a>
  57. <a class="button is-info is-inverted">Inverted</a>
  58. <a class="button is-success is-inverted">Inverted</a>
  59. <a class="button is-danger is-inverted">Inverted</a>
  60. {% endcapture %}
  61. {% capture button_inverted_outlined_example %}
  62. <a class="button is-primary is-inverted is-outlined">Invert Outlined</a>
  63. <a class="button is-link is-inverted is-outlined">Invert Outlined</a>
  64. <a class="button is-info is-inverted is-outlined">Invert Outlined</a>
  65. <a class="button is-success is-inverted is-outlined">Invert Outlined</a>
  66. <a class="button is-danger is-inverted is-outlined">Invert Outlined</a>
  67. {% endcapture %}
  68. {% capture button_rounded_example %}
  69. <a class="button is-rounded">Rounded</a>
  70. <a class="button is-primary is-rounded">Rounded</a>
  71. <a class="button is-link is-rounded">Rounded</a>
  72. <a class="button is-info is-rounded">Rounded</a>
  73. <a class="button is-success is-rounded">Rounded</a>
  74. <a class="button is-danger is-rounded">Rounded</a>
  75. {% endcapture %}
  76. {% capture button_normal_example %}
  77. <a class="button">Normal</a>
  78. <a class="button is-primary">Normal</a>
  79. <a class="button is-link">Normal</a>
  80. <a class="button is-info">Normal</a>
  81. <a class="button is-success">Normal</a>
  82. <a class="button is-warning">Normal</a>
  83. <a class="button is-danger">Normal</a>
  84. {% endcapture %}
  85. {% capture button_hover_example %}
  86. <a class="button is-hovered">Hover</a>
  87. <a class="button is-primary is-hovered">Hover</a>
  88. <a class="button is-link is-hovered">Hover</a>
  89. <a class="button is-info is-hovered">Hover</a>
  90. <a class="button is-success is-hovered">Hover</a>
  91. <a class="button is-warning is-hovered">Hover</a>
  92. <a class="button is-danger is-hovered">Hover</a>
  93. {% endcapture %}
  94. {% capture button_focus_example %}
  95. <a class="button is-focused">Focus</a>
  96. <a class="button is-primary is-focused">Focus</a>
  97. <a class="button is-link is-focused">Focus</a>
  98. <a class="button is-info is-focused">Focus</a>
  99. <a class="button is-success is-focused">Focus</a>
  100. <a class="button is-warning is-focused">Focus</a>
  101. <a class="button is-danger is-focused">Focus</a>
  102. {% endcapture %}
  103. {% capture button_active_example %}
  104. <a class="button is-active">Active</a>
  105. <a class="button is-primary is-active">Active</a>
  106. <a class="button is-link is-active">Active</a>
  107. <a class="button is-info is-active">Active</a>
  108. <a class="button is-success is-active">Active</a>
  109. <a class="button is-warning is-active">Active</a>
  110. <a class="button is-danger is-active">Active</a>
  111. {% endcapture %}
  112. {% capture button_loading_example %}
  113. <a class="button is-loading">Loading</a>
  114. <a class="button is-primary is-loading">Loading</a>
  115. <a class="button is-link is-loading">Loading</a>
  116. <a class="button is-info is-loading">Loading</a>
  117. <a class="button is-success is-loading">Loading</a>
  118. <a class="button is-warning is-loading">Loading</a>
  119. <a class="button is-danger is-loading">Loading</a>
  120. {% endcapture %}
  121. {% capture button_static_example %}
  122. <span class="button is-static">Static</span>
  123. {% endcapture %}
  124. {% capture button_disabled_example %}
  125. <a class="button" title="Disabled button" disabled>Disabled</a>
  126. <a class="button is-primary" title="Disabled button" disabled>Disabled</a>
  127. <a class="button is-link" title="Disabled button" disabled>Disabled</a>
  128. <a class="button is-info" title="Disabled button" disabled>Disabled</a>
  129. <a class="button is-success" title="Disabled button" disabled>Disabled</a>
  130. <a class="button is-warning" title="Disabled button" disabled>Disabled</a>
  131. <a class="button is-danger" title="Disabled button" disabled>Disabled</a>
  132. {% endcapture %}
  133. {% capture button_fa_example %}
  134. <p class="buttons">
  135. <a class="button">
  136. <span class="icon is-small">
  137. <i class="fas fa-bold"></i>
  138. </span>
  139. </a>
  140. <a class="button">
  141. <span class="icon is-small">
  142. <i class="fas fa-italic"></i>
  143. </span>
  144. </a>
  145. <a class="button">
  146. <span class="icon is-small">
  147. <i class="fas fa-underline"></i>
  148. </span>
  149. </a>
  150. </p>
  151. <p class="buttons">
  152. <a class="button">
  153. <span class="icon">
  154. <i class="fab fa-github"></i>
  155. </span>
  156. <span>GitHub</span>
  157. </a>
  158. <a class="button is-primary">
  159. <span class="icon">
  160. <i class="fab fa-twitter"></i>
  161. </span>
  162. <span>Twitter</span>
  163. </a>
  164. <a class="button is-success">
  165. <span class="icon is-small">
  166. <i class="fas fa-check"></i>
  167. </span>
  168. <span>Save</span>
  169. </a>
  170. <a class="button is-danger is-outlined">
  171. <span>Delete</span>
  172. <span class="icon is-small">
  173. <i class="fas fa-times"></i>
  174. </span>
  175. </a>
  176. </p>
  177. <p class="buttons">
  178. <a class="button is-small">
  179. <span class="icon is-small">
  180. <i class="fab fa-github"></i>
  181. </span>
  182. <span>GitHub</span>
  183. </a>
  184. <a class="button">
  185. <span class="icon">
  186. <i class="fab fa-github"></i>
  187. </span>
  188. <span>GitHub</span>
  189. </a>
  190. <a class="button is-medium">
  191. <span class="icon">
  192. <i class="fab fa-github"></i>
  193. </span>
  194. <span>GitHub</span>
  195. </a>
  196. <a class="button is-large">
  197. <span class="icon is-medium">
  198. <i class="fab fa-github"></i>
  199. </span>
  200. <span>GitHub</span>
  201. </a>
  202. </p>
  203. {% endcapture %}
  204. {% capture button_only_icon_example %}
  205. <p class="buttons">
  206. <a class="button is-small">
  207. <span class="icon is-small">
  208. <i class="fas fa-heading"></i>
  209. </span>
  210. </a>
  211. </p>
  212. <p class="buttons">
  213. <a class="button">
  214. <span class="icon is-small">
  215. <i class="fas fa-heading"></i>
  216. </span>
  217. </a>
  218. <a class="button">
  219. <span class="icon">
  220. <i class="fas fa-heading fa-lg"></i>
  221. </span>
  222. </a>
  223. </p>
  224. <p class="buttons">
  225. <a class="button is-medium">
  226. <span class="icon is-small">
  227. <i class="fas fa-heading"></i>
  228. </span>
  229. </a>
  230. <a class="button is-medium">
  231. <span class="icon">
  232. <i class="fas fa-heading fa-lg"></i>
  233. </span>
  234. </a>
  235. <a class="button is-medium">
  236. <span class="icon is-medium">
  237. <i class="fas fa-heading fa-2x"></i>
  238. </span>
  239. </a>
  240. </p>
  241. <p class="buttons">
  242. <a class="button is-large">
  243. <span class="icon is-small">
  244. <i class="fas fa-heading"></i>
  245. </span>
  246. </a>
  247. <a class="button is-large">
  248. <span class="icon">
  249. <i class="fas fa-heading fa-lg"></i>
  250. </span>
  251. </a>
  252. <a class="button is-large">
  253. <span class="icon is-medium">
  254. <i class="fas fa-heading fa-2x"></i>
  255. </span>
  256. </a>
  257. </p>
  258. {% endcapture %}
  259. {% capture button_group_example %}
  260. <div class="field is-grouped">
  261. <p class="control">
  262. <a class="button is-link">
  263. Save changes
  264. </a>
  265. </p>
  266. <p class="control">
  267. <a class="button">
  268. Cancel
  269. </a>
  270. </p>
  271. <p class="control">
  272. <a class="button is-danger">
  273. Delete post
  274. </a>
  275. </p>
  276. </div>
  277. {% endcapture %}
  278. {% capture button_addons_example %}
  279. <div class="field has-addons">
  280. <p class="control">
  281. <a class="button">
  282. <span class="icon is-small">
  283. <i class="fas fa-align-left"></i>
  284. </span>
  285. <span>Left</span>
  286. </a>
  287. </p>
  288. <p class="control">
  289. <a class="button">
  290. <span class="icon is-small">
  291. <i class="fas fa-align-center"></i>
  292. </span>
  293. <span>Center</span>
  294. </a>
  295. </p>
  296. <p class="control">
  297. <a class="button">
  298. <span class="icon is-small">
  299. <i class="fas fa-align-right"></i>
  300. </span>
  301. <span>Right</span>
  302. </a>
  303. </p>
  304. </div>
  305. {% endcapture %}
  306. {% capture button_group_addons_example %}
  307. <div class="field has-addons">
  308. <p class="control">
  309. <a class="button">
  310. <span class="icon is-small">
  311. <i class="fas fa-bold"></i>
  312. </span>
  313. <span>Bold</span>
  314. </a>
  315. </p>
  316. <p class="control">
  317. <a class="button">
  318. <span class="icon is-small">
  319. <i class="fas fa-italic"></i>
  320. </span>
  321. <span>Italic</span>
  322. </a>
  323. </p>
  324. <p class="control">
  325. <a class="button">
  326. <span class="icon is-small">
  327. <i class="fas fa-underline"></i>
  328. </span>
  329. <span>Underline</span>
  330. </a>
  331. </p>
  332. </div>
  333. <div class="field has-addons">
  334. <p class="control">
  335. <a class="button">
  336. <span class="icon is-small">
  337. <i class="fas fa-align-left"></i>
  338. </span>
  339. <span>Left</span>
  340. </a>
  341. </p>
  342. <p class="control">
  343. <a class="button">
  344. <span class="icon is-small">
  345. <i class="fas fa-align-center"></i>
  346. </span>
  347. <span>Center</span>
  348. </a>
  349. </p>
  350. <p class="control">
  351. <a class="button">
  352. <span class="icon is-small">
  353. <i class="fas fa-align-right"></i>
  354. </span>
  355. <span>Right</span>
  356. </a>
  357. </p>
  358. </div>
  359. {% endcapture %}
  360. {% capture buttons_list %}
  361. <div class="buttons">
  362. <span class="button is-success">Save changes</span>
  363. <span class="button is-info">Save and continue</span>
  364. <span class="button is-danger">Cancel</span>
  365. </div>
  366. {% endcapture %}
  367. {% capture buttons_multiple %}
  368. <div class="buttons">
  369. <span class="button">One</span>
  370. <span class="button">Two</span>
  371. <span class="button">Three</span>
  372. <span class="button">Four</span>
  373. <span class="button">Five</span>
  374. <span class="button">Six</span>
  375. <span class="button">Seven</span>
  376. <span class="button">Eight</span>
  377. <span class="button">Nine</span>
  378. <span class="button">Ten</span>
  379. <span class="button">Eleven</span>
  380. <span class="button">Twelve</span>
  381. <span class="button">Thirteen</span>
  382. <span class="button">Fourteen</span>
  383. <span class="button">Fifteen</span>
  384. <span class="button">Sixteen</span>
  385. <span class="button">Seventeen</span>
  386. <span class="button">Eighteen</span>
  387. <span class="button">Nineteen</span>
  388. <span class="button">Twenty</span>
  389. </div>
  390. {% endcapture %}
  391. {% capture buttons_addons %}
  392. <div class="buttons has-addons">
  393. <span class="button">Yes</span>
  394. <span class="button">Maybe</span>
  395. <span class="button">No</span>
  396. </div>
  397. {% endcapture %}
  398. {% capture buttons_addons_centered %}
  399. <div class="buttons has-addons is-centered">
  400. <span class="button">Yes</span>
  401. <span class="button">Maybe</span>
  402. <span class="button">No</span>
  403. </div>
  404. {% endcapture %}
  405. {% capture buttons_addons_right %}
  406. <div class="buttons has-addons is-right">
  407. <span class="button">Yes</span>
  408. <span class="button">Maybe</span>
  409. <span class="button">No</span>
  410. </div>
  411. {% endcapture %}
  412. {% capture buttons_addons_selected %}
  413. <div class="buttons has-addons">
  414. <span class="button is-success is-selected">Yes</span>
  415. <span class="button">Maybe</span>
  416. <span class="button">No</span>
  417. </div>
  418. <div class="buttons has-addons">
  419. <span class="button">Yes</span>
  420. <span class="button is-info is-selected">Maybe</span>
  421. <span class="button">No</span>
  422. </div>
  423. <div class="buttons has-addons">
  424. <span class="button">Yes</span>
  425. <span class="button">Maybe</span>
  426. <span class="button is-danger is-selected">No</span>
  427. </div>
  428. {% endcapture %}
  429. <div class="content">
  430. <p>
  431. The <strong>button</strong> is an essential element of any design. It's meant to look and behave as an <strong>interactive</strong> element of your page.
  432. </p>
  433. </div>
  434. {% include elements/snippet.html wrapper="buttons" content=button_example %}
  435. <div class="content">
  436. <p>
  437. The <code>.button</code> class can be used on:
  438. </p>
  439. <ul>
  440. <li>
  441. <code>&lt;a&gt;</code> anchor links
  442. </li>
  443. <li>
  444. <code>&lt;button&gt;</code> form buttons
  445. </li>
  446. <li>
  447. <code>&lt;input type="submit"&gt;</code> submit inputs
  448. </li>
  449. <li>
  450. <code>&lt;input type="reset"&gt;</code> reset inputs
  451. </li>
  452. </ul>
  453. </div>
  454. {% include elements/snippet.html wrapper="buttons" content=button_tags_example %}
  455. {% include elements/anchor.html name="Colors" %}
  456. {% include elements/snippet.html wrapper="buttons" content=button_colors_a_example %}
  457. {% include elements/snippet.html wrapper="buttons" content=button_colors_b_example %}
  458. {% include elements/anchor.html name="Sizes" %}
  459. {% include elements/snippet.html wrapper="buttons" content=button_sizes_example %}
  460. {% include elements/anchor.html name="Styles" %}
  461. <h4 class="subtitle">Outlined</h4>
  462. {% include elements/snippet.html wrapper="buttons" content=button_outlined_example %}
  463. <h4 class="subtitle">Inverted (the text color becomes the background color, and vice-versa)</h4>
  464. <div class="columns">
  465. <div class="column">
  466. <div class="bd-callout is-primary">
  467. <div class="buttons">
  468. {{ button_inverted_example }}
  469. </div>
  470. </div>
  471. </div>
  472. <div class="column">
  473. {% highlight html %}{{button_inverted_example}}{% endhighlight %}
  474. </div>
  475. </div>
  476. <h4 class="subtitle">Invert Outlined (the invert color becomes the text and border colors)</h4>
  477. <div class="columns">
  478. <div class="column">
  479. <div class="bd-callout is-primary">
  480. <div class="buttons">
  481. {{ button_inverted_outlined_example }}
  482. </div>
  483. </div>
  484. </div>
  485. <div class="column">
  486. {% highlight html %}{{ button_inverted_outlined_example }}{% endhighlight %}
  487. </div>
  488. </div>
  489. <h4 class="subtitle">Rounded buttons</h4>
  490. <div class="columns">
  491. <div class="column">
  492. {% include elements/new-tag.html version="0.6.2" %}
  493. <div class="buttons">
  494. {{ button_rounded_example }}
  495. </div>
  496. </div>
  497. <div class="column">
  498. {% highlight html %}{{ button_rounded_example }}{% endhighlight %}
  499. </div>
  500. </div>
  501. {% include elements/anchor.html name="States" %}
  502. <h4 class="subtitle">Normal</h4>
  503. {% include elements/snippet.html wrapper="buttons" content=button_normal_example %}
  504. <h4 class="subtitle">Hover</h4>
  505. {% include elements/snippet.html wrapper="buttons" content=button_hover_example %}
  506. <h4 class="subtitle">Focus</h4>
  507. {% include elements/snippet.html wrapper="buttons" content=button_focus_example %}
  508. <h4 class="subtitle">Active</h4>
  509. {% include elements/snippet.html wrapper="buttons" content=button_active_example %}
  510. <h4 class="subtitle">Loading</h4>
  511. <div class="columns">
  512. <div class="column">
  513. <div class="buttons">
  514. {{ button_loading_example }}
  515. </div>
  516. <div class="message is-info">
  517. <div class="message-body">
  518. <p>
  519. Since the loading spinner is implemented using the <code>:after</code> pseudo-element, it is not supported by the <code>&lt;input type="submit"&gt;</code> element.
  520. </p>
  521. </div>
  522. </div>
  523. </div>
  524. <div class="column">
  525. {% highlight html %}{{button_loading_example}}{% endhighlight %}
  526. </div>
  527. </div>
  528. <h4 id="static-button" class="subtitle">
  529. Static
  530. </h4>
  531. <div class="columns">
  532. <div class="column">
  533. <div class="content">
  534. <p>
  535. You can create a <strong>non-interactive button</strong> by using the <code>is-static</code> modifier. This is useful to align a text label with an input, for example when using <a href="{{site.url}}/documentation/form/general#form-addons">form addons</a>.
  536. </p>
  537. </div>
  538. {{ button_static_example }}
  539. </div>
  540. <div class="column">
  541. {% highlight html %}{{ button_static_example }}{% endhighlight %}
  542. </div>
  543. </div>
  544. <h4 class="subtitle">Disabled</h4>
  545. <div class="columns">
  546. <div class="column">
  547. <div class="buttons">
  548. {{ button_disabled_example }}
  549. </div>
  550. <div class="message is-danger">
  551. <div class="message-body">
  552. <p>The <code>is-disabled</code> CSS class has been deprecated in favor of the <code>disabled</code> HTML attribute. <a href="https://github.com/jgthms/bulma/issues/276">Learn more</a></p>
  553. </div>
  554. </div>
  555. </div>
  556. <div class="column">
  557. {% highlight html %}{{button_disabled_example}}{% endhighlight %}
  558. </div>
  559. </div>
  560. <h4 class="subtitle">With Font Awesome icons</h4>
  561. {% include elements/snippet.html content=button_fa_example clipped=true %}
  562. <div class="columns">
  563. <div class="column">
  564. <div class="content">
  565. <p>
  566. If the button only contains an icon, Bulma will make sure the button remains <strong>square</strong>, no matter the size of the button <em>or</em> of the icon.
  567. </p>
  568. </div>
  569. {{ button_only_icon_example }}
  570. </div>
  571. <div class="column">
  572. {% highlight html %}{{ button_only_icon_example }}{% endhighlight %}
  573. </div>
  574. </div>
  575. {% include elements/anchor.html name="Button group" %}
  576. <div class="content">
  577. <p>If you want to <strong>group</strong> buttons together on a <strong>single line</strong>, use the <code>is-grouped</code> modifier on the <code>field</code> container:</p>
  578. </div>
  579. {% include elements/snippet.html content=button_group_example %}
  580. {% include elements/anchor.html name="Button addons" %}
  581. <div class="content">
  582. <p>If you want to use buttons as <strong>addons</strong>, use the <code>has-addons</code> modifier on the <code>field</code> container:</p>
  583. </div>
  584. {% include elements/snippet.html content=button_addons_example %}
  585. {% include elements/anchor.html name="Button group with addons" %}
  586. <div class="content">
  587. <p>You can group together addons as well:</p>
  588. </div>
  589. {% include elements/snippet.html content=button_group_addons_example %}
  590. {% include elements/anchor.html name="List of buttons" %}
  591. {% include elements/new-tag.html version="0.6.1" %}
  592. <div class="columns">
  593. <div class="column">
  594. <div class="content">
  595. <p>
  596. You can now create a <strong>list of buttons</strong> with the <code>.buttons</code> container.
  597. </p>
  598. </div>
  599. <div class="bd-example">
  600. {{ buttons_list }}
  601. </div>
  602. </div>
  603. <div class="column">
  604. {% highlight html %}{{ buttons_list }}{% endhighlight %}
  605. </div>
  606. </div>
  607. <div class="columns">
  608. <div class="column">
  609. <div class="content">
  610. <p>
  611. If the list is <strong>very long</strong>, it will automatically wrap on <strong>multiple lines</strong>, while keeping all buttons <strong>evenly spaced</strong>.
  612. </p>
  613. </div>
  614. <div class="bd-example">
  615. {{ buttons_multiple }}
  616. </div>
  617. </div>
  618. <div class="column highlight-full">
  619. {% highlight html %}{{ buttons_multiple }}{% endhighlight %}
  620. </div>
  621. </div>
  622. <div class="columns">
  623. <div class="column">
  624. <div class="content">
  625. <p>
  626. You can <strong>attach buttons together</strong> with the <code>.has-addons</code> modifier.
  627. </p>
  628. </div>
  629. <div class="bd-example">
  630. {{ buttons_addons }}
  631. </div>
  632. </div>
  633. <div class="column highlight-full">
  634. {% highlight html %}{{ buttons_addons }}{% endhighlight %}
  635. </div>
  636. </div>
  637. <div class="columns">
  638. <div class="column">
  639. <div class="content">
  640. <p>
  641. Use the <code>is-centered</code> or the <code>is-right</code> modifiers to alter the <strong>alignment</strong>.
  642. </p>
  643. </div>
  644. <div class="bd-example">
  645. {{ buttons_addons_centered }}
  646. {{ buttons_addons_right }}
  647. </div>
  648. </div>
  649. <div class="column highlight-full">
  650. {% highlight html %}{{ buttons_addons_centered }}{{ buttons_addons_right }}{% endhighlight %}
  651. </div>
  652. </div>
  653. <div class="columns">
  654. <div class="column">
  655. <div class="content">
  656. <p>
  657. You can use any <strong>modifier</strong> class on each button to differentiate them. Make sure to add the <code>is-selected</code> modifier as well to make sure the selected button is <em>above</em> its siblings.
  658. </p>
  659. </div>
  660. <div class="bd-example">
  661. {{ buttons_addons_selected }}
  662. </div>
  663. </div>
  664. <div class="column highlight-full">
  665. {% highlight html %}{{ buttons_addons_selected }}{% endhighlight %}
  666. </div>
  667. </div>
  668. <div class="message is-info">
  669. <div class="message-header">
  670. <p>Difference between <a href="{{ site.url }}/documentation/form/general/#form-group">form groups</a> and <strong>list of buttons</strong></p>
  671. </div>
  672. <div class="message-body">
  673. <div class="content">
  674. <p>
  675. While this list of buttons style can be achieved with either <code>field is-grouped</code> or the new <code>buttons</code> class, there are a few differences:
  676. </p>
  677. <ul>
  678. <li>
  679. <code>buttons</code> has a <strong>simpler markup</strong>
  680. </li>
  681. <li>
  682. <code>buttons</code> can only contain <code>button</code> elements
  683. </li>
  684. <li>
  685. <code>field is-grouped</code> can contain <em>any</em> type of <code>control</code> inputs
  686. </li>
  687. <li>
  688. <code>field is-grouped</code> can be forced to fit all controls on a <strong>single line</strong>
  689. </li>
  690. <li>
  691. with <code>field is-grouped</code> you can <strong>expand</strong> one of the controls
  692. </li>
  693. </ul>
  694. <p>
  695. Basically, if you only want a list of <em>buttons</em>, using <code>buttons</code> is recommended. If you need more control on the styling and the elements, use a <a href="{{ site.url }}/documentation/form/general/#form-group">form group</a>.
  696. </p>
  697. </div>
  698. </div>
  699. </div>
  700. {% include elements/variables.html type='element' %}