|
| 1 | +<template> |
| 2 | + |
| 3 | + <page-template title="Buttons" :completed="false"> |
| 4 | + |
| 5 | + <h2><code>{{ kButtonApi.name }}</code> API</h2> |
| 6 | + <component-docs :api="kButtonApi" /> |
| 7 | + |
| 8 | + <h2>Code Example</h2> |
| 9 | + <vue-example :code="example" /> |
| 10 | + |
| 11 | + <h2>Guidelines</h2> |
| 12 | + |
| 13 | + <h3>Scope</h3> |
| 14 | + <p> |
| 15 | + This is meant to cover 90% of buttons. There will always be edge cases, |
| 16 | + and common sense always trumps rote rules. Maintain consistency as much as |
| 17 | + possible, but don’t make significant sacrifices in the UX for the sake of |
| 18 | + consistency. |
| 19 | + </p> |
| 20 | + |
| 21 | + <h3>Types of buttons</h3> |
| 22 | + <p> |
| 23 | + There are 3 main types of buttons, each to map to a different level of |
| 24 | + visual hierarchy |
| 25 | + </p> |
| 26 | + <ul> |
| 27 | + <li>Raised buttons for more prominent actions</li> |
| 28 | + <li>Flat buttons for less prominent or actions that repeat in a list</li> |
| 29 | + <li>Hyperlink text for very deemphasized actions or in paragraphs.</li> |
| 30 | + </ul> |
| 31 | + |
| 32 | + <h3>Dropdown buttons</h3> |
| 33 | + <p> |
| 34 | + In areas where multiple actions are necessary, raised or flat buttons |
| 35 | + can be made into dropdown buttons, which have multiple actions nested |
| 36 | + underneath them in a menu |
| 37 | + </p> |
| 38 | + <p> |
| 39 | + The label on a dropdown button is not an action itself, but rather |
| 40 | + should label the group of actions that are nested under the button |
| 41 | + </p> |
| 42 | + <p> |
| 43 | + If a single action is more important or prominent than the others, it |
| 44 | + can be brought out as its own individual button, next to the menu with |
| 45 | + more actions |
| 46 | + </p> |
| 47 | + |
| 48 | + <h3>Language</h3> |
| 49 | + <p> |
| 50 | + Buttons should aim to have a single word in them, with two at most |
| 51 | + </p> |
| 52 | + <p> |
| 53 | + The buttons language should avoid any ambiguity, be specific to the |
| 54 | + action you are completing. For example, use 'Save' instead of 'OK'. |
| 55 | + </p> |
| 56 | + <p> |
| 57 | + Never use commas or other punctuation in buttons |
| 58 | + </p> |
| 59 | + |
| 60 | + <h3>Color usage</h3> |
| 61 | + <p> |
| 62 | + Primary/affirmative actions should be purple |
| 63 | + </p> |
| 64 | + <p> |
| 65 | + Secondary/cancel actions should be grey |
| 66 | + </p> |
| 67 | + <p> |
| 68 | + Tertiary links should always use purple |
| 69 | + </p> |
| 70 | + |
| 71 | + <h3>Button placement</h3> |
| 72 | + <p> |
| 73 | + Buttons should be right aligned in modals |
| 74 | + </p> |
| 75 | + <p> |
| 76 | + Global actions on tables should be put above the table and right aligned |
| 77 | + </p> |
| 78 | + <p> |
| 79 | + Deviates from these patterns are fine with common sense |
| 80 | + </p> |
| 81 | + |
| 82 | + <h3>Iconography</h3> |
| 83 | + <p> |
| 84 | + Aside from the dropdown icon, there is no iconography in buttons |
| 85 | + </p> |
| 86 | + |
| 87 | + <h3>Responsive</h3> |
| 88 | + <p> |
| 89 | + Buttons should be determined by the size of the text in them, with a min |
| 90 | + width. They should not generally transform based on the size of the |
| 91 | + page. |
| 92 | + </p> |
| 93 | + <p> |
| 94 | + Buttons should elide if you really really really have but pls don’t thx |
| 95 | + </p> |
| 96 | + |
| 97 | + <h4>Language</h4> |
| 98 | + <ul> |
| 99 | + <li>Buttons should be specific to action</li> |
| 100 | + <li>Ideally 1 word, no more than 2 words</li> |
| 101 | + </ul> |
| 102 | + <h4>Color usage</h4> |
| 103 | + <ul> |
| 104 | + <li>Use fushia for primary actions #996189</li> |
| 105 | + <li>Grey for secondary action or cancel #EEEEEE</li> |
| 106 | + </ul> |
| 107 | + <h4>Iconography</h4> |
| 108 | + <ul> |
| 109 | + <li>No iconography aside from dropdown carrot</li> |
| 110 | + </ul> |
| 111 | + <h4>Placement on page</h4> |
| 112 | + <ul> |
| 113 | + <li>Right aligned on modals</li> |
| 114 | + <li>Top right for major creation actions</li> |
| 115 | + </ul> |
| 116 | + |
| 117 | + </page-template> |
| 118 | + |
| 119 | +</template> |
| 120 | + |
| 121 | + |
| 122 | +<script> |
| 123 | +
|
| 124 | + import componentDocs from '../../shell/component-docs'; |
| 125 | + import vueExample from '../../shell/vue-example'; |
| 126 | + import pageTemplate from '../../shell/page-template'; |
| 127 | +
|
| 128 | + import example from 'raw-loader!./example.html'; |
| 129 | + import kButtonApi from '!vue-doc!kolibri.coreVue.components.kButton'; |
| 130 | +
|
| 131 | + import FullVue from 'vue/dist/vue.common'; |
| 132 | + import kButton from 'kolibri.coreVue.components.kButton'; |
| 133 | + FullVue.component('k-button', kButton); |
| 134 | +
|
| 135 | + export default { |
| 136 | + components: { |
| 137 | + pageTemplate, |
| 138 | + componentDocs, |
| 139 | + vueExample, |
| 140 | + }, |
| 141 | + data: () => ({ |
| 142 | + kButtonApi, |
| 143 | + example, |
| 144 | + }), |
| 145 | + }; |
| 146 | +
|
| 147 | +</script> |
| 148 | + |
| 149 | + |
| 150 | +<style lang="stylus" scoped></style> |
0 commit comments