button.html 24 KB

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