| 1 |
--- |
| 2 |
id: Divider |
| 3 |
section: components |
| 4 |
cssPrefix: pf-v6-c-divider |
| 5 |
---import './Divider.css' |
| 6 |
|
| 7 |
## Examples |
| 8 |
|
| 9 |
### hr |
| 10 |
|
| 11 |
```html |
| 12 |
<hr class="pf-v6-c-divider" /> |
| 13 |
|
| 14 |
``` |
| 15 |
|
| 16 |
### li |
| 17 |
|
| 18 |
```html |
| 19 |
<ul role="list"> |
| 20 |
<li>List item one</li> |
| 21 |
<li class="pf-v6-c-divider" role="presentation"></li> |
| 22 |
<li>List item two</li> |
| 23 |
</ul> |
| 24 |
|
| 25 |
``` |
| 26 |
|
| 27 |
### div |
| 28 |
|
| 29 |
```html |
| 30 |
<div class="pf-v6-c-divider" role="separator"></div> |
| 31 |
|
| 32 |
``` |
| 33 |
|
| 34 |
### Inset medium |
| 35 |
|
| 36 |
```html |
| 37 |
<hr class="pf-v6-c-divider pf-m-inset-md" /> |
| 38 |
|
| 39 |
``` |
| 40 |
|
| 41 |
### Md inset, no inset on md, 3xl inset on lg, lg inset on xl |
| 42 |
|
| 43 |
```html |
| 44 |
<hr |
| 45 |
class="pf-v6-c-divider pf-m-inset-md pf-m-inset-none-on-md pf-m-inset-3xl-on-lg pf-m-inset-lg-on-xl" |
| 46 |
/> |
| 47 |
|
| 48 |
``` |
| 49 |
|
| 50 |
### Vertical |
| 51 |
|
| 52 |
```html |
| 53 |
<div class="pf-v6-c-divider pf-m-vertical" role="separator"></div> |
| 54 |
|
| 55 |
``` |
| 56 |
|
| 57 |
### Vertical, inset medium |
| 58 |
|
| 59 |
```html |
| 60 |
<div class="pf-v6-c-divider pf-m-vertical pf-m-inset-md" role="separator"></div> |
| 61 |
|
| 62 |
``` |
| 63 |
|
| 64 |
### Vertical, md inset, no inset on md, lg inset on lg, sm inset on xl |
| 65 |
|
| 66 |
```html |
| 67 |
<div |
| 68 |
class="pf-v6-c-divider pf-m-vertical pf-m-inset-md pf-m-inset-none-on-md pf-m-inset-lg-on-lg pf-m-inset-sm-on-xl" |
| 69 |
role="separator" |
| 70 |
></div> |
| 71 |
|
| 72 |
``` |
| 73 |
|
| 74 |
### Vertical on lg |
| 75 |
|
| 76 |
```html |
| 77 |
<div |
| 78 |
class="pf-v6-c-divider pf-m-horizontal pf-m-vertical-on-lg" |
| 79 |
role="separator" |
| 80 |
></div> |
| 81 |
|
| 82 |
``` |
| 83 |
|
| 84 |
### Horizontal on lg |
| 85 |
|
| 86 |
```html |
| 87 |
<div |
| 88 |
class="pf-v6-c-divider pf-m-horizontal-on-lg pf-m-vertical" |
| 89 |
role="separator" |
| 90 |
></div> |
| 91 |
|
| 92 |
``` |
| 93 |
|
| 94 |
### In flex layout |
| 95 |
|
| 96 |
```html |
| 97 |
<strong>Horizontal</strong> |
| 98 |
<br /> |
| 99 |
<br /> |
| 100 |
<div class="pf-v6-l-flex"> |
| 101 |
<div class="pf-v6-l-flex__item">item 1</div> |
| 102 |
|
| 103 |
<div class="pf-v6-c-divider pf-m-vertical" role="separator"></div> |
| 104 |
<div class="pf-v6-l-flex__item">item 1</div> |
| 105 |
</div> |
| 106 |
<br /> |
| 107 |
<br /> |
| 108 |
<strong>Vertical</strong> |
| 109 |
<br /> |
| 110 |
<br /> |
| 111 |
<div class="pf-v6-l-flex pf-m-column"> |
| 112 |
<div class="pf-v6-l-flex__item">item 1</div> |
| 113 |
|
| 114 |
<div class="pf-v6-c-divider" role="separator"></div> |
| 115 |
<div class="pf-v6-l-flex__item">item 1</div> |
| 116 |
</div> |
| 117 |
|
| 118 |
``` |
| 119 |
|
| 120 |
## Documentation |
| 121 |
|
| 122 |
### Overview |
| 123 |
|
| 124 |
The divider renders as an `<hr>` by default. It is possible to make the divider render as an `li` or a `div` to match the HTML5 specification and context of the divider. |
| 125 |
|
| 126 |
| Attribute | Applied to | Outcome | |
| 127 |
| -- | -- | -- | |
| 128 |
| `role="separator"` | `li.pf-v6-c-divider`, `div.pf-v6-c-divider` | Indicates that the separator is a separator. | |
| 129 |
|
| 130 |
### Usage |
| 131 |
|
| 132 |
| Class | Applied to | Outcome | |
| 133 |
| -- | -- | -- | |
| 134 |
| `.pf-v6-c-divider` | `<hr>`, `<li>`, `<div>` | Defines the divider component. | |
| 135 |
| `.pf-m-vertical` | `.pf-v6-c-divider` | Modifies the divider component from horizontal to vertical. This modifier requires that the parent has an explicit or implicit height, or has a flex or grid based layout parent. | |
| 136 |
| `.pf-m-inset-{none, sm, md, lg, xl, 2xl, 3xl}{-on-[sm, md, lg, xl, 2xl]}` | `.pf-v6-c-divider` | Modifies divider padding/inset to visually match padding of other adjacent components. | |
| 137 |
| `.pf-m-hidden{-on-[breakpoint]}` | `.pf-v6-c-divider` | Modifies a divider to be hidden, at optional [breakpoint](/foundations-and-styles/design-tokens/all-design-tokens). | |
| 138 |
| `.pf-m-visible{-on-[breakpoint]}` | `.pf-v6-c-divider` | Modifies a divider to be shown, at optional [breakpoint](/foundations-and-styles/design-tokens/all-design-tokens). | |