|
| 1 | +--- |
| 2 | +extends: _layouts.documentation |
| 3 | +title: "Forms" |
| 4 | +--- |
| 5 | + |
| 6 | +# Forms |
| 7 | + |
| 8 | +<div class="mt-8"> |
| 9 | + <div class="bg-blue-lightest border-l-4 border-blue-light rounded-b text-blue-darkest px-4 py-3"> |
| 10 | + <div class="flex"> |
| 11 | + <div class="py-1"> |
| 12 | + <svg class="h-6 w-6 text-blue-light mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10zm0-2c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm-.5-5h1c.276 0 .5.224.5.5v1c0 .276-.224.5-.5.5h-1c-.276 0-.5-.224-.5-.5v-1c0-.276.224-.5.5-.5zm0-8h1c.276 0 .5.224.5.5V8l-.5 3-1 .5L9 8V5.5c0-.276.224-.5.5-.5z"/></svg> |
| 13 | + </div> |
| 14 | + <div> |
| 15 | + <p class="font-semibold">Work in progress!</p> |
| 16 | + <p class="text-sm">More detailed examples are coming soon.</p> |
| 17 | + </div> |
| 18 | + </div> |
| 19 | + </div> |
| 20 | +</div> |
| 21 | + |
| 22 | +## Login Form |
| 23 | + |
| 24 | +@component('_partials.code-sample', ['class' => 'px-3 py-10 bg-grey-lighter flex justify-center']) |
| 25 | +<div class="w-full max-w-xs"> |
| 26 | + <form class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"> |
| 27 | + <div class="mb-4"> |
| 28 | + <label class="block text-grey-darker text-sm font-bold mb-2" for="username"> |
| 29 | + Username |
| 30 | + </label> |
| 31 | + <input class="shadow appearance-none border rounded w-full py-2 px-3 text-grey-dark" id="username" type="text" placeholder="Username"> |
| 32 | + </div> |
| 33 | + <div class="mb-6"> |
| 34 | + <label class="block text-grey-darker text-sm font-bold mb-2" for="password"> |
| 35 | + Password |
| 36 | + </label> |
| 37 | + <input class="shadow appearance-none border border-red rounded w-full py-2 px-3 text-grey-dark mb-3" id="password" type="password" placeholder="******************"> |
| 38 | + <p class="text-red text-xs italic">Please choose a password.</p> |
| 39 | + </div> |
| 40 | + <div class="flex items-center justify-between"> |
| 41 | + <button class="bg-blue hover:bg-blue-dark text-white font-bold py-2 px-4 rounded" type="button"> |
| 42 | + Sign In |
| 43 | + </button> |
| 44 | + <a class="inline-block align-baseline font-bold text-sm text-blue hover:text-blue-darker" href="#"> |
| 45 | + Forgot Password? |
| 46 | + </a> |
| 47 | + </div> |
| 48 | + </form> |
| 49 | + <p class="text-center text-grey text-xs"> |
| 50 | + ©{{ date('Y') }} Acme Corp. All rights reserved. |
| 51 | + </p> |
| 52 | +</div> |
| 53 | +@endcomponent |
| 54 | + |
| 55 | +## Inline Form |
| 56 | + |
| 57 | +@component('_partials.code-sample', ['class' => 'flex justify-center p-8']) |
| 58 | +<form class="w-full max-w-xs"> |
| 59 | + <div class="md:flex md:items-center mb-6"> |
| 60 | + <div class="md:w-1/3"> |
| 61 | + <label class="block text-slate-light font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-full-name"> |
| 62 | + Full Name |
| 63 | + </label> |
| 64 | + </div> |
| 65 | + <div class="md:w-2/3"> |
| 66 | + <input class="bg-grey-lighter appearance-none border-2 border-grey-lighter hover:border-purple rounded w-full py-2 px-4 text-grey-dark" id="inline-full-name" type="text" value="Jane Doe"> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + <div class="md:flex md:items-center mb-6"> |
| 70 | + <div class="md:w-1/3"> |
| 71 | + <label class="block text-slate-light font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-username"> |
| 72 | + Password |
| 73 | + </label> |
| 74 | + </div> |
| 75 | + <div class="md:w-2/3"> |
| 76 | + <input class="bg-grey-lighter appearance-none border-2 border-grey-lighter hover:border-purple rounded w-full py-2 px-4 text-grey-dark" id="inline-username" type="password" placeholder="******************"> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + <div class="md:flex md:items-center mb-6"> |
| 80 | + <div class="md:w-1/3"></div> |
| 81 | + <label class="md:w-2/3 block text-slate-light font-bold"> |
| 82 | + <input class="mr-2" type="checkbox"> |
| 83 | + <span class="text-sm"> |
| 84 | + Send me your newsletter! |
| 85 | + </span> |
| 86 | + </label> |
| 87 | + </div> |
| 88 | + <div class="md:flex md:items-center"> |
| 89 | + <div class="md:w-1/3"></div> |
| 90 | + <div class="md:w-2/3"> |
| 91 | + <button class="shadow bg-purple hover:bg-purple-light text-white font-bold py-2 px-4 rounded" type="button"> |
| 92 | + Sign Up |
| 93 | + </button> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | +</form> |
| 97 | +@endcomponent |
| 98 | + |
| 99 | +## Form Grid |
| 100 | + |
| 101 | +@component('_partials.code-sample', ['class' => 'flex justify-center p-8']) |
| 102 | +<form class="w-full max-w-md"> |
| 103 | + <div class="-mx-3 md:flex mb-6"> |
| 104 | + <div class="md:w-1/2 px-3 mb-6 md:mb-0"> |
| 105 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-first-name"> |
| 106 | + First Name |
| 107 | + </label> |
| 108 | + <input class="appearance-none block w-full bg-grey-lighter text-slate border border-red rounded py-3 px-4 mb-3" id="grid-first-name" type="text" placeholder="Jane"> |
| 109 | + <p class="text-red text-xs italic">Please fill out this field.</p> |
| 110 | + </div> |
| 111 | + <div class="md:w-1/2 px-3"> |
| 112 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-last-name"> |
| 113 | + Last Name |
| 114 | + </label> |
| 115 | + <input class="appearance-none block w-full bg-grey-lighter text-slate border border-grey-lighter rounded py-3 px-4" id="grid-last-name" type="text" placeholder="Doe"> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + <div class="-mx-3 md:flex mb-6"> |
| 119 | + <div class="md:w-full px-3"> |
| 120 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-password"> |
| 121 | + Password |
| 122 | + </label> |
| 123 | + <input class="appearance-none block w-full bg-grey-lighter text-slate border border-grey-lighter rounded py-3 px-4 mb-3" id="grid-password" type="password" placeholder="******************"> |
| 124 | + <p class="text-grey-dark text-xs italic">Make it as long and as crazy as you'd like</p> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + <div class="-mx-3 md:flex mb-2"> |
| 128 | + <div class="md:w-1/2 px-3 mb-6 md:mb-0"> |
| 129 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-city"> |
| 130 | + City |
| 131 | + </label> |
| 132 | + <input class="appearance-none block w-full bg-grey-lighter text-slate border border-grey-lighter rounded py-3 px-4" id="grid-city" type="text" placeholder="Albuquerque"> |
| 133 | + </div> |
| 134 | + <div class="md:w-1/2 px-3"> |
| 135 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-select"> |
| 136 | + State |
| 137 | + </label> |
| 138 | + <select class="appearance-none block w-full bg-grey-lighter text-slate border border-grey-lighter rounded py-3 px-4" id="grid-select" style='background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAABGdBTUEAALGPC/xhBQAAAQtJREFUOBG1lEEOgjAQRalbGj2OG9caOACn4ALGtfEuHACiazceR1PWOH/CNA3aMiTaBDpt/7zPdBKy7M/DCL9pGkvxxVp7KsvyJftL5rZt1865M+Ucq6pyyF3hNcI7Cuu+728QYn/JQA5yKaempxuZmQngOwEaYx55nu+1lQh8GIatMGi+01NwBcEmhxBqK4nAPZJ78K0KKFAJmR3oPp8+Iwgob0Oa6+TLoeCvRx+mTUYf/FVBGTPRwDkfLxnaSrRwcH0FWhNOmrkWYbE2XEicqgSa1J0LQ+aPCuQgZiLnwewbGuz5MGoAhcIkCQcjaTBjMgtXGURMVHC1wcQEy0J+Zlj8bKAnY1/UzDe2dbAVqfXn6wAAAABJRU5ErkJggg=="); background-position: right 0.8rem center; background-repeat: no-repeat; background-size: 0.8rem'> |
| 139 | + <option value="">New Mexico</option> |
| 140 | + <option value="">Missouri</option> |
| 141 | + <option value="">Texas</option> |
| 142 | + </select> |
| 143 | + </div> |
| 144 | + <div class="md:w-1/2 px-3"> |
| 145 | + <label class="block uppercase leading-loose text-slate text-xs font-bold mb-2" for="grid-zip"> |
| 146 | + Zip |
| 147 | + </label> |
| 148 | + <input class="appearance-none block w-full bg-grey-lighter text-slate border border-grey-lighter rounded py-3 px-4" id="grid-zip" type="text" placeholder="90210"> |
| 149 | + </div> |
| 150 | + </div> |
| 151 | +</form> |
| 152 | +@endcomponent |
| 153 | + |
| 154 | + |
| 155 | +## Underline Form |
| 156 | + |
| 157 | +@component('_partials.code-sample', ['class' => 'flex justify-center p-8']) |
| 158 | +<form class="w-full max-w-sm"> |
| 159 | + <div class="flex items-center border-b border-b-2 border-teal py-2"> |
| 160 | + <input class="appearance-none bg-transparent border-none w-full text-grey-dark mr-3 py-1 px-2" id="underline-full-name" type="text" placeholder="Jane Doe"> |
| 161 | + <button class="bg-teal hover:bg-teal-dark border-teal hover:border-teal-dark text-sm border-4 text-white py-1 px-2 rounded" type="button"> |
| 162 | + Sign Up |
| 163 | + </button> |
| 164 | + <button class="border-transparent border-4 text-teal hover:text-teal-darker text-sm py-1 px-2 rounded" type="button"> |
| 165 | + Cancel |
| 166 | + </button> |
| 167 | + </div> |
| 168 | +</form> |
| 169 | +@endcomponent |
0 commit comments