|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: "Drop" |
| 4 | +--- |
| 5 | + |
| 6 | +# Drop |
| 7 | + |
| 8 | +- [Basic](#basic) |
| 9 | +- [Position](#position) |
| 10 | + |
| 11 | +## Basic |
| 12 | +The most use case of **Drop** is Drop Menu, it use stacked nav |
| 13 | +component as it's content. |
| 14 | + |
| 15 | +<div class="u-mb-15"> |
| 16 | + <div class="c-drop"> |
| 17 | + <button class="btn btn--primary c-drop__toggle">Click Me</button> |
| 18 | + <div class="c-drop__content c-drop__content--bottomStart"> |
| 19 | + <ul class="c-nav c-nav--pills c-nav--stacked"> |
| 20 | + <li class="c-nav__item"> |
| 21 | + <a role="button" class="c-nav__link is-active">Profile</a> |
| 22 | + </li> |
| 23 | + <li class="c-nav__item"> |
| 24 | + <a role="button" class="c-nav__link">Inbox</a> |
| 25 | + </li> |
| 26 | + <li class="c-nav__item"> |
| 27 | + <a role="button" class="c-nav__link is-disabled">Task</a> |
| 28 | + </li> |
| 29 | + <li class="c-nav__divider"></li> |
| 30 | + <li class="c-nav__item"> |
| 31 | + <a role="button" class="c-nav__link">Log out</a> |
| 32 | + </li> |
| 33 | + </ul> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | +</div> |
| 37 | + |
| 38 | +```html |
| 39 | +<div class="c-drop"> |
| 40 | + <button class="btn btn--primary c-drop__toggle">Click Me</button> |
| 41 | + <div class="c-drop__content c-drop__content--bottomStart"> |
| 42 | + <ul class="c-nav c-nav--pills c-nav--stacked"> |
| 43 | + <li class="c-nav__item"> |
| 44 | + <a role="button" class="c-nav__link is-active">Profile</a> |
| 45 | + </li> |
| 46 | + <li class="c-nav__item"> |
| 47 | + <a role="button" class="c-nav__link">Inbox</a> |
| 48 | + </li> |
| 49 | + <li class="c-nav__item"> |
| 50 | + <a role="button" class="c-nav__link is-disabled">Task</a> |
| 51 | + </li> |
| 52 | + <li class="c-nav__divider"></li> |
| 53 | + <li class="c-nav__item"> |
| 54 | + <a role="button" class="c-nav__link">Log out</a> |
| 55 | + </li> |
| 56 | + </ul> |
| 57 | + </div> |
| 58 | +</div> |
| 59 | +``` |
| 60 | + |
| 61 | +<div class="c-note c-note--warning u-mt-40"> |
| 62 | +Point only use pure css trick `.c-drop__toggle:active` to simulate click and show drop content. And Point does <strong>not</strong> include any JavaScript interaction with <strong>Drop</strong>. You need to implement the class toggle yourself. |
| 63 | +</div> |
| 64 | + |
| 65 | +## Position |
| 66 | +The default position of **Drop Content** is bottomStart. |
| 67 | +You can change the position by adding modifier classes below |
| 68 | +on `.c-drop__content` container element. |
| 69 | + |
| 70 | +- `.c-drop-topStart` |
| 71 | +- `.c-drop-top` |
| 72 | +- `.c-drop-topEnd` |
| 73 | +- `.c-drop-rightStart` |
| 74 | +- `.c-drop-right` |
| 75 | +- `.c-drop-rightEnd` |
| 76 | +- `.c-drop-bottomStart` |
| 77 | +- `.c-drop-bottom` |
| 78 | +- `.c-drop-bottomEnd` |
| 79 | +- `.c-drop-leftStart` |
| 80 | +- `.c-drop-left` |
| 81 | +- `.c-drop-leftEnd` |
| 82 | + |
| 83 | +<div class="u-mb-15"> |
| 84 | + <div class="c-drop"> |
| 85 | + <button class="btn btn--primary c-drop__toggle">Click Me</button> |
| 86 | + <div class="c-drop__content c-drop__content--topStart"> |
| 87 | + <form action="#" class="form-inline u-p-10"> |
| 88 | + <div class="form-group"> |
| 89 | + <input type="text" class="form-input" value="Edit Me"> |
| 90 | + </div> |
| 91 | + <div class="form-group"> |
| 92 | + <button type="button" class="btn btn--info">Submit</button> |
| 93 | + </div> |
| 94 | + </form> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | +</div> |
| 98 | + |
| 99 | +```html |
| 100 | +<div class="c-drop"> |
| 101 | + <button class="btn btn--primary c-drop__toggle">Click Me</button> |
| 102 | + <div class="c-drop__content c-drop__content--topStart"> |
| 103 | + <form action="#" class="form-inline u-p-10"> |
| 104 | + <div class="form-group"> |
| 105 | + <input type="text" class="form-input" value="Edit Me"> |
| 106 | + </div> |
| 107 | + <div class="form-group"> |
| 108 | + <button type="button" class="btn btn--info">Submit</button> |
| 109 | + </div> |
| 110 | + </form> |
| 111 | + </div> |
| 112 | +</div> |
| 113 | +``` |
0 commit comments