1
0

buttons.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Buttons - Puppertino Framework</title>
  5. <link rel="stylesheet" href="../index-assets/bootstrap-utilities.css">
  6. <link rel="stylesheet" href="../index-assets/bootstrap-grid.min.css">
  7. <link
  8. href="https://rsms.me/inter/inter.css"
  9. rel="stylesheet"
  10. />
  11. <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/codedgar/Puppertino@latest/dist/css/newfull.css" />
  12. <meta charset="utf-8" />
  13. <meta
  14. name="viewport"
  15. content="width=device-width, initial-scale=1, shrink-to-fit=no"
  16. />
  17. <meta http-equiv="x-ua-compatible" content="ie=edge" />
  18. <link rel="stylesheet" type="text/css" href="doc.css" />
  19. <meta
  20. name="description"
  21. content="This is the documentation for Buttons on the Puppertino Framework, a framework that mimics Apple's design, woof!"
  22. />
  23. <link rel="icon" type="image/png" href="../landing-images/doggo.png" />
  24. <!-- Global site tag (gtag.js) - Google Analytics -->
  25. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-176821843-1"></script>
  26. <script>
  27. window.dataLayer = window.dataLayer || [];
  28. function gtag(){dataLayer.push(arguments);}
  29. gtag('js', new Date());
  30. gtag('config', 'UA-176821843-1');
  31. </script>
  32. </head>
  33. <body class="p-layout">
  34. <div class="route">
  35. <a
  36. href="https://codedgar.github.io/Puppertino/"
  37. class="p-btn p-btn-scope p-btn-scope-unactive"
  38. >Puppertino</a
  39. >
  40. <p>/</p>
  41. <a href="index.html" class="p-btn p-btn-scope p-btn-scope-unactive"
  42. >Examples</a
  43. >
  44. <p>/</p>
  45. <a href="buttons.html" class="p-btn p-btn-scope">Buttons</a>
  46. </div>
  47. <div class="p-docs-alert">
  48. <div>
  49. <svg viewBox="0 0 24 24" width="50" height="50" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
  50. </div>
  51. <div>
  52. <h3>Alert</h3>
  53. <p>
  54. Some of the components/functionalities provided in this version of the framework will be changing moving forward. <br>
  55. To keep yourself updated, and understand how to migrate to newer versions, follow <a href="https://codedgar.com" target="_blank">@codedgar_dev</a></p>
  56. </div>
  57. </div>
  58. <h1>Buttons</h1>
  59. <div class="master">
  60. <p>
  61. Buttons are a key component of any interface, serving as interactive elements that guide user actions. In Puppertino, buttons have been designed with flexibility and accessibility in mind, supporting a variety of use cases across links, buttons, and form submissions.
  62. </p>
  63. <div class="talk-about-it">
  64. <h2>Push Buttons.</h2>
  65. <p>
  66. Push buttons come in several variations to suit different scenarios. They can be implemented as <code class="code">&#60;a></code> or <code class="code">&#60;button></code> elements, depending on the context.
  67. <br><br>
  68. For cases where buttons need to be disabled, the <strong>disabled</strong> and the <strong>tabindex="-1"</strong> attributes can be applied to prevent user interaction. This ensures that the buttons are visually and functionally consistent with your design while maintaining clear communication with users about available actions.
  69. </p>
  70. <div class="row">
  71. <div class="col-md-6 mt-lg-5">
  72. <div class="d-flex align-baseline mt-5">
  73. <button class="p-btn">Default</button>
  74. <button class="p-btn p-btn-destructive">Destructive</button>
  75. <button class="p-btn" disabled="">Disabled</button>
  76. <a href="#" class="p-btn p-prim-col">Primary</a>
  77. <a href="#" class="p-btn p-btn-mob">Btn mob</a>
  78. <a href="#" class="p-btn p-btn-round p-orange p-white-color p-white-color">Rounded</a>
  79. <a href="#" class="p-btn p-btn-outline">Outline</a>
  80. <a href="#" class="p-btn p-btn-outline-dash">Outline dashed</a>
  81. <a href="#" class="p-btn p-btn-more">Custom action</a>
  82. </div>
  83. </div>
  84. <div class="col-md-6 mt-lg-5">
  85. <p>Usage:</p>
  86. <div class="code">
  87. <pre>
  88. <code class="html">
  89. &#60;a href="#" class="p-btn">Default&#60;/a>
  90. &#60;button class="p-btn p-btn-destructive">Destructive&#60;/button>
  91. &#60;a href="#" class="p-btn p-btn-disabled" disabled>Disabled&#60;/a>
  92. &#60;a href="#" class="p-btn p-prim-col">Primary&#60;/a>
  93. &#60;a href="#" class="p-btn p-btn-mob">Btn mob&#60;/a>
  94. &#60;a href="#" class="p-btn p-btn-round">Rounded&#60;/a>
  95. &#60;a href="#" class="p-btn p-btn-more">Custom action&#60;/a>
  96. </code>
  97. </pre>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="talk-about-it">
  103. <h2>Button colors</h2>
  104. <p>
  105. Customizing button colors in Puppertino is now easier and more flexible. In earlier versions, applying the <code class="code">p-btn-mob</code> class was required for color changes. In the latest release, any button's color can be modified without additional classes.
  106. <br><br>
  107. You can select from the predefined colors in <a href="/docs/examples/color_palette.html">Puppertino's color palette</a> or apply custom colors directly via your own CSS, giving you full control over button styling to match your design needs.
  108. </p>
  109. <button class="p-btn p-prim-col p-grape p-white-color p-white-color">Primary Purple</button>
  110. <button class="p-btn p-lime p-white-color p-white-color">Success</button>
  111. <button class="p-btn p-prim-col p-orange p-white-color p-white-color">Danger</button>
  112. <button class="p-btn p-prim-col p-strawberry p-white-color p-white-color">Error</button>
  113. <p>Usage:</p>
  114. <div class="code">
  115. <pre>
  116. <code class="html">
  117. &#60;button class="p-btn p-prim-col p-grape p-white-color p-white-color">Primary Purple&#60;/button>
  118. &#60;button class="p-btn p-btn-mob p-lime p-white-color p-white-color">Success&#60;/button>
  119. &#60;button class="p-btn p-btn-mob p-orange p-white-color p-white-color">Danger&#60;/button>
  120. &#60;button class="p-btn p-btn-mob p-strawberry p-white-color p-white-color">Error&#60;/button>
  121. </code>
  122. </pre>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="talk-about-it">
  128. <h2>Button sizing</h2>
  129. <p>
  130. Button sizing was one of the most requested features during Puppertino's alpha phase. In response to that feedback, Puppertino now offers four distinct button sizes, providing flexibility to fit various design contexts:
  131. </p>
  132. <div class="row">
  133. <div class="col-md-6 mt-lg-5">
  134. <a href="#" class="p-btn p-btn-mob p-btn-sm">Small size</a>
  135. <a href="#" class="p-btn p-btn-mob p-btn-md">Medium size</a>
  136. <a href="#" class="p-btn p-btn-mob p-btn-lg">Large size</a>
  137. <a href="#" class="p-btn p-btn-mob p-btn-block">Block size</a>
  138. </div>
  139. <div class="col-md-6">
  140. <p>Usage:</p>
  141. <div class="code">
  142. <pre>
  143. <code class="html">
  144. &#60;a href="#" class="p-btn p-btn-sm">Small size&#60;/a>
  145. &#60;a href="#" class="p-btn p-btn-md">Medium size&#60;/a>
  146. &#60;a href="#" class="p-btn p-btn-lg">Large size&#60;/a>
  147. &#60;a href="#" class="p-btn p-btn-block">Block size&#60;/a>
  148. </code>
  149. </pre>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="talk-about-it">
  155. <h2>Icon button.</h2>
  156. <p>
  157. The Icon Button, previously known as the "Help Button", is a circular button that contains an icon. You can use a letter, font-based icons (such as Font Awesome), or an SVG. For more details on available icons, refer to the <a href="https://codedgar.github.io/Puppertino/examples/icons.html">icons section</a>.
  158. <br><br>
  159. For accessibility, always make sure to add descriptive text to the icon button using the <strong>aria-label</strong> attribute.
  160. <br><br>
  161. Customization is straightforward: you can modify the border and icon colors using the <code class="code">color</code> property or by applying classes from the <a href="/docs/examples/color_palette.html">Color palette</a>. If you'd like to remove the button's borders, simply add the <code class="code">p-btn-icon-no-border</code> class.
  162. </p>
  163. <a href="#" class="p-btn-icon" aria-label="Help Button">?</a>
  164. <a href="#" class="p-btn-icon p-lime-color" aria-label="Dog Button">🐶</a>
  165. <a href="#" class="p-btn-icon p-bubblegum-color" aria-label="Like button">
  166. <svg viewBox="0 0 24 24" width="13" height="13" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>
  167. </a>
  168. <a href="#" class="p-btn-icon p-strawberry-color" aria-label="Delete button">
  169. <svg viewBox="0 0 24 24" width="13" height="13" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
  170. </a>
  171. <a href="#" class="p-btn-icon p-orange p-silver-100-color p-btn-icon-no-border" aria-label="Delete User Button">
  172. <svg viewBox="0 0 24 24" width="13" height="13" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="23" y1="11" x2="17" y2="11"></line></svg>
  173. </a>
  174. <a href="#" class="p-btn-icon p-mint p-silver-100-color" aria-label="Bold Text Button">
  175. <svg viewBox="0 0 24 24" width="13" height="13" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path><path d="M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path></svg>
  176. </a>
  177. <p>Usage:</p>
  178. <div class="code">
  179. <pre>
  180. <code class="html">
  181. &#60;a href="#" class="p-btn-icon" aria-label="Help Button">?&#60;/a>
  182. &#60;a href="#" class="p-btn-icon" aria-label="Custom Button">&#60;!-- SVG ICON HERE -->&#60;/a>
  183. &#60;a href="#" class="p-btn-icon p-mint p-silver-100-color" aria-label="Custom Color Button">Custom Color&#60;/a>
  184. </code>
  185. </pre>
  186. </div>
  187. </div>
  188. <div class="talk-about-it">
  189. <h2>Scope buttons.</h2>
  190. <p>
  191. Scope Buttons function similarly to Push Buttons but are designed specifically for use in navigation routes. They should not replace standard buttons but complement them in route-based contexts.
  192. </p>
  193. <ul>
  194. <li><strong>Default/Active Button</strong>: This button highlights the current route, indicating where the user is within the interface.</li>
  195. <li><strong>Inactive Button</strong>: Used to represent the route the user has just navigated from, providing a clear visual distinction.</li>
  196. <li><strong>Action Button</strong>: This button is designed to prompt user actions, such as saving, copying, or other route-specific tasks.</li>
  197. </ul>
  198. <a href="#" class="p-btn p-btn-scope">Default/Active</a>
  199. <a href="#" class="p-btn p-btn-scope p-btn-scope-unactive">Unactive</a>
  200. <a href="#" class="p-btn p-btn-scope p-btn-disabled" disabled="true" tabindex="-1">Disabled</a>
  201. <a href="#" class="p-btn p-btn-scope p-btn-scope-outline">Action</a>
  202. <a href="#" class="p-btn p-btn-scope p-btn-scope-outline p-btn-outline-dash">Action</a>
  203. <p>Usage:</p>
  204. <div class="code">
  205. <pre>
  206. <code class="html">
  207. &#60;a href="#" class="p-btn p-btn-scope">Default/Active&#60;/a>
  208. &#60;a href="#" class="p-btn p-btn-scope p-btn-scope-unactive">Unactive&#60;/a>
  209. &#60;a href="#" class="p-btn p-btn-scope p-btn-disabled" disabled="true" tabindex="-1">Disabled&#60;/a>
  210. &#60;a href="#" class="p-btn p-btn-scope p-btn-scope-outline">Action&#60;/a>
  211. </code>
  212. </pre>
  213. </div>
  214. </div>
  215. </div>
  216. </body>
  217. <script src="https://cdn.jsdelivr.net/gh/codedgar/Puppertino@latest/src/js/dakmode_manager.js"></script>
  218. <script
  219. type="text/javascript"
  220. src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js"
  221. ></script>
  222. <script defer>
  223. hljs.initHighlightingOnLoad();
  224. </script>
  225. </html>