| 1 |
--- |
| 2 |
id: 'Button' |
| 3 |
section: components |
| 4 |
cssPrefix: pf-d-button |
| 5 |
---## Examples |
| 6 |
|
| 7 |
### Progress button - initial |
| 8 |
|
| 9 |
```html |
| 10 |
<form class="pf-v6-c-form pf-m-limit-width" novalidate> |
| 11 |
<div class="pf-v6-c-form__group"> |
| 12 |
<div class="pf-v6-c-form__group-label"><label class="pf-v6-c-form__label" for="progress-button-example-login"> |
| 13 |
<span class="pf-v6-c-form__label-text">Username</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 14 |
</div> |
| 15 |
<div class="pf-v6-c-form__group-control"> |
| 16 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 17 |
<input |
| 18 |
required |
| 19 |
type="text" |
| 20 |
id="progress-button-example-login" |
| 21 |
name="progress-button-example-login" |
| 22 |
value="johndoe" |
| 23 |
/> |
| 24 |
</span> |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
<div class="pf-v6-c-form__group"> |
| 28 |
<div class="pf-v6-c-form__group-label"><label class="pf-v6-c-form__label" for="progress-button-example-password"> |
| 29 |
<span class="pf-v6-c-form__label-text">Password</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 30 |
</div> |
| 31 |
<div class="pf-v6-c-form__group-control"> |
| 32 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 33 |
<input |
| 34 |
required |
| 35 |
type="password" |
| 36 |
value="p@ssw0rd" |
| 37 |
id="progress-button-example-password" |
| 38 |
name="progress-button-example-password" |
| 39 |
/> |
| 40 |
</span> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
<div class="pf-v6-c-form__group pf-m-action"> |
| 44 |
<div class="pf-v6-c-form__actions"> |
| 45 |
<button class="pf-v6-c-button pf-m-primary" type="submit"> |
| 46 |
<span class="pf-v6-c-button__text">Link account and log in</span> |
| 47 |
</button> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
</form> |
| 51 |
|
| 52 |
``` |
| 53 |
|
| 54 |
### Progress button - loading |
| 55 |
|
| 56 |
```html |
| 57 |
<form class="pf-v6-c-form pf-m-limit-width" novalidate> |
| 58 |
<div class="pf-v6-c-form__group"> |
| 59 |
<div class="pf-v6-c-form__group-label"><label |
| 60 |
class="pf-v6-c-form__label" |
| 61 |
for="progress-button-loading-example-login" |
| 62 |
> |
| 63 |
<span class="pf-v6-c-form__label-text">Username</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 64 |
</div> |
| 65 |
<div class="pf-v6-c-form__group-control"> |
| 66 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 67 |
<input |
| 68 |
required |
| 69 |
type="text" |
| 70 |
id="progress-button-loading-example-login" |
| 71 |
name="progress-button-loading-example-login" |
| 72 |
value="johndoe" |
| 73 |
/> |
| 74 |
</span> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
<div class="pf-v6-c-form__group"> |
| 78 |
<div class="pf-v6-c-form__group-label"><label |
| 79 |
class="pf-v6-c-form__label" |
| 80 |
for="progress-button-loading-example-password" |
| 81 |
> |
| 82 |
<span class="pf-v6-c-form__label-text">Password</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 83 |
</div> |
| 84 |
<div class="pf-v6-c-form__group-control"> |
| 85 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 86 |
<input |
| 87 |
required |
| 88 |
type="password" |
| 89 |
value="p@ssw0rd" |
| 90 |
id="progress-button-loading-example-password" |
| 91 |
name="progress-button-loading-example-password" |
| 92 |
/> |
| 93 |
</span> |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
<div class="pf-v6-c-form__group pf-m-action"> |
| 97 |
<div class="pf-v6-c-form__actions"> |
| 98 |
<button |
| 99 |
class="pf-v6-c-button pf-m-in-progress pf-m-progress pf-m-primary" |
| 100 |
type="submit" |
| 101 |
> |
| 102 |
<span class="pf-v6-c-button__progress"> |
| 103 |
<svg |
| 104 |
class="pf-v6-c-spinner pf-m-md" |
| 105 |
role="progressbar" |
| 106 |
viewBox="0 0 100 100" |
| 107 |
aria-label="Loading..." |
| 108 |
> |
| 109 |
<circle |
| 110 |
class="pf-v6-c-spinner__path" |
| 111 |
cx="50" |
| 112 |
cy="50" |
| 113 |
r="45" |
| 114 |
fill="none" |
| 115 |
/> |
| 116 |
</svg> |
| 117 |
</span> |
| 118 |
|
| 119 |
<span class="pf-v6-c-button__text">Linking account</span> |
| 120 |
</button> |
| 121 |
</div> |
| 122 |
</div> |
| 123 |
</form> |
| 124 |
|
| 125 |
``` |
| 126 |
|
| 127 |
### Progress button - complete |
| 128 |
|
| 129 |
```html |
| 130 |
<form class="pf-v6-c-form pf-m-limit-width" novalidate> |
| 131 |
<div class="pf-v6-c-form__group"> |
| 132 |
<div class="pf-v6-c-form__group-label"><label |
| 133 |
class="pf-v6-c-form__label" |
| 134 |
for="progress-button-complete-example-login" |
| 135 |
> |
| 136 |
<span class="pf-v6-c-form__label-text">Username</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 137 |
</div> |
| 138 |
<div class="pf-v6-c-form__group-control"> |
| 139 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 140 |
<input |
| 141 |
required |
| 142 |
type="text" |
| 143 |
id="progress-button-complete-example-login" |
| 144 |
name="progress-button-complete-example-login" |
| 145 |
value="johndoe" |
| 146 |
/> |
| 147 |
</span> |
| 148 |
</div> |
| 149 |
</div> |
| 150 |
<div class="pf-v6-c-form__group"> |
| 151 |
<div class="pf-v6-c-form__group-label"><label |
| 152 |
class="pf-v6-c-form__label" |
| 153 |
for="progress-button-complete-example-password" |
| 154 |
> |
| 155 |
<span class="pf-v6-c-form__label-text">Password</span> <span class="pf-v6-c-form__label-required" aria-hidden="true">*</span></label> |
| 156 |
</div> |
| 157 |
<div class="pf-v6-c-form__group-control"> |
| 158 |
<span class="pf-v6-c-form-control pf-m-required"> |
| 159 |
<input |
| 160 |
required |
| 161 |
type="password" |
| 162 |
value="p@ssw0rd" |
| 163 |
id="progress-button-complete-example-password" |
| 164 |
name="progress-button-complete-example-password" |
| 165 |
/> |
| 166 |
</span> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
<div class="pf-v6-c-form__group pf-m-action"> |
| 170 |
<div class="pf-v6-c-form__actions"> |
| 171 |
<button class="pf-v6-c-button pf-m-primary" type="submit"> |
| 172 |
<span class="pf-v6-c-button__icon pf-m-start"> |
| 173 |
<svg |
| 174 |
class="pf-v6-svg" |
| 175 |
fill="currentColor" |
| 176 |
viewBox="0 0 512 512" |
| 177 |
aria-hidden="true" |
| 178 |
role="img" |
| 179 |
width="1em" |
| 180 |
height="1em" |
| 181 |
> |
| 182 |
<path |
| 183 |
d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z" |
| 184 |
/> |
| 185 |
</svg> |
| 186 |
</span> |
| 187 |
<span class="pf-v6-c-button__text">Logged in</span> |
| 188 |
</button> |
| 189 |
</div> |
| 190 |
</div> |
| 191 |
</form> |
| 192 |
|
| 193 |
``` |