| 1 |
--- |
| 2 |
id: Content |
| 3 |
section: components |
| 4 |
cssPrefix: pf-v6-c-content |
| 5 |
propComponents: ['Content', 'ContentVariants'] |
| 6 |
--- |
| 7 |
|
| 8 |
The `<Content>` component allows you to establish a block of HTML content and apply simple, built-in styling. `<Content>` can be used for any element supported by the `component` property (including `h1` through `h6`, `hr`, `p`, `a`, `small`, `blockquote`, and `pre`). |
| 9 |
|
| 10 |
You cannot nest other components within `<Content>`, and doing so can cause styling overrides or other conflicts. Instead, you can use the `<Content>` component's properties to achieve the same results. |
| 11 |
|
| 12 |
For example, to create a level 1 heading, you should pass `component="h1"` to `<Content>`, instead of nesting a `<Title>` component within `<Content>`. Similarly, when you need to add a divider to a page, you should utilize the `hr` property of `<Content>` (which is styled as a divider), rather than using a separate `<Divider>` component. |
| 13 |
|
| 14 |
## Examples |
| 15 |
|
| 16 |
HTML elements wrapped by `<Content>` are styled by the content component. |
| 17 |
|
| 18 |
### Content as a wrapper |
| 19 |
|
| 20 |
```ts file="./ContentWrapper.tsx" |
| 21 |
|
| 22 |
``` |
| 23 |
|
| 24 |
### Headings |
| 25 |
|
| 26 |
```ts file="./ContentHeadings.tsx" |
| 27 |
|
| 28 |
``` |
| 29 |
|
| 30 |
### Body |
| 31 |
|
| 32 |
```ts file="./ContentBody.tsx" |
| 33 |
|
| 34 |
``` |
| 35 |
|
| 36 |
### Unordered list |
| 37 |
|
| 38 |
```ts file="./ContentUnorderedList.tsx" |
| 39 |
|
| 40 |
``` |
| 41 |
|
| 42 |
### Ordered list |
| 43 |
|
| 44 |
```ts file="./ContentOrderedList.tsx" |
| 45 |
|
| 46 |
``` |
| 47 |
|
| 48 |
### Plain list |
| 49 |
|
| 50 |
```ts file="./ContentPlainList.tsx" |
| 51 |
|
| 52 |
``` |
| 53 |
|
| 54 |
### Description list |
| 55 |
|
| 56 |
```ts file="./ContentDescriptionList.tsx" |
| 57 |
|
| 58 |
``` |
| 59 |
|
| 60 |
### Link and visited link |
| 61 |
|
| 62 |
```ts file="./ContentVisited.tsx" |
| 63 |
|
| 64 |
``` |
| 65 |
|
| 66 |
### Editorial content |
| 67 |
|
| 68 |
Editorial styling increases the font size of body text and small text by 1 tier, where body text becomes "lg" and small text becomes "md". To applying editorial styling, use `isEditorial`. |
| 69 |
|
| 70 |
```ts file="./ContentEditorial.tsx" |
| 71 |
|
| 72 |
``` |