You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.4KB

  1. ---
  2. title: "Bulma Components"
  3. subtitle: "A Bulma Test Document"
  4. author:
  5. - name: Garrick Aden-Buie
  6. url: https://garrickadenbuie.com
  7. extra:
  8. - "First Affiliation"
  9. - "@tweeter345"
  10. date: '`r strftime(Sys.time(), "%A, %B %e, %Y")`'
  11. bulma:
  12. hero: ["info"]
  13. hero_body: "has-text-left"
  14. hero_button: "outlined"
  15. hero_links:
  16. - name: Github
  17. url: https://github.com/gadenbuie
  18. icon: '`r bulma::fa_icon("github")`'
  19. - name: Home
  20. url: https://garrickadenbuie.com
  21. icon: '`r bulma::fa_icon("home")`'
  22. output: bulma::bulma_document
  23. ---
  24. ```{r setup, include=FALSE}
  25. knitr::opts_chunk$set(echo = TRUE)
  26. library(bulma)
  27. ```
  28. ## Messages
  29. ### message full with title and delete button
  30. ```{r}
  31. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  32. header = "Hello World", delete = TRUE)
  33. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  34. header = "Hello World", delete = TRUE, width = "two-thirds", centered = TRUE)
  35. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  36. header = "Hello World", delete = TRUE, width = "half", centered = FALSE)
  37. ```
  38. ### message full with title no delete button
  39. ```{r}
  40. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  41. header = "Hello World")
  42. ```
  43. ### message full no title with delete button
  44. ```{r}
  45. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", delete = TRUE)
  46. ```
  47. <article class="message">
  48. <div class="message-header">
  49. <p></p>
  50. <button class="delete" aria-label="delete"></button>
  51. </div>
  52. <div class="message-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
  53. </article>
  54. ### message errors with bad header
  55. ```{r, error=TRUE}
  56. bulma_message("Test", header = TRUE)
  57. ```
  58. ### message with colors
  59. ```{r}
  60. m <- lapply(bulma_constants("colors")[1:10], function(color) {
  61. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  62. header = paste("Color:", color), color = color)
  63. })
  64. htmltools::tagList(m)
  65. ```
  66. ### message body only
  67. ```{r, results="asis"}
  68. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
  69. ```
  70. ### message with size
  71. ```{r, results="asis"}
  72. m <- lapply(c("small", "medium", "large"), function (size) {
  73. bulma_message("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  74. header = paste("Size:", size), size = size)
  75. })
  76. htmltools::tagList(m)
  77. ```