button.html 22 KB

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