# Paragraph

The paragraph class allows you to separate the content into paragraphs. It is responsible for displaying inline elements such as **Span**, **HyperlinkRangeStart** and **End**, **InlineImage** etc. You are also able to configure the appearance of the paragraph by modifying its parameters.

This topic will explain you how to:

* [Use Paragraphs](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-paragraph#use-paragraphs)

* [Add inline elements to a Paragraph](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-paragraph#add-inline-elements-to-a-paragraph)

* [Customize the Paragraph](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-paragraph#customize-the-paragraph)

> tip To modify the document content at runtime we recommend using the [RadDocumentEditor](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/features/raddocumenteditor) class when possible, instead of working with `RadDocument` directly. The document editor ensures that the document will be measured and arranged properly on each change.

## Use Paragraphs

The **Paragraph** can be used only in the context of a [Section](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-section) or a TableCell element. The section exposes a collection of Blocks, to which the paragraphs can be added. This can also be done directly in XAML.

```XAML
	<telerik:RadRichTextBox x:Name="radRichTextBox">
	    <telerik:RadRichTextBox.Document>
	        <telerik:RadDocument LayoutMode="Paged">
	            <telerik:Section>
	                <telerik:Paragraph />
	                <telerik:Paragraph />
	            </telerik:Section>
	        </telerik:RadDocument>
	    </telerik:RadRichTextBox.Document>
	</telerik:RadRichTextBox>
```

```C#
Section section = new Section();
Paragraph paragraph = new Paragraph();
section.Blocks.Add(paragraph );
	RadDocument document = new RadDocument();
document.Sections.Add(section);
	
	this.radRichTextBox.Document = document;
```

```VB.NET
	Dim section As New Section()
	Dim paragraph As New Paragraph()
	section.Blocks.Add(paragraph)
	Dim document As New RadDocument()
	document.Sections.Add(section)
	
	Me.radRichTextBox.Document = document
```

## Add inline elements to a Paragraph

To add inline elements such as Span, HyperlinkRangeStart and End, or InlineImage you have to use the Inlines collection of the Paragraph. In XAML you can directly wrap the inline elements inside the paragraph element.

```XAML
	<telerik:RadRichTextBox x:Name="radRichTextBox">
	    <telerik:RadDocument>
	        <telerik:Section>
	            <telerik:Paragraph>
	                <telerik:Span Text="Span declared in XAML" />
	            </telerik:Paragraph>
	        </telerik:Section>
	    </telerik:RadDocument>
	</telerik:RadRichTextBox>
```

```C#
	Section section = new Section();
        Paragraph paragraph = new Paragraph();
        Span span = new Span("Span declared in code-behind");
        paragraph.Inlines.Add(span );
	section.Blocks.Add(paragraph );
	RadDocument document = new RadDocument();
        document.Sections.Add(section);
	
	this.radRichTextBox.Document = document;
```

```VB.NET
	Dim section As New Section()
	Dim paragraph As New Paragraph()
	Dim span As New Span("Span declared in code-behind")
	paragraph.Inlines.Add(span)
	section.Blocks.Add(paragraph)
	Dim document As New RadDocument()
	document.Sections.Add(section)
	
	Me.radRichTextBox.Document = document
```

## Customize the Paragraph

The **Paragraph** exposes several properties that allow you to customize the layout of the elements placed underneath it. Here is a list of them:

* **FontSize**: Represents the font size of the text inside the **Paragraph**. If not explicitly set to its child elements, they inherit its value.

* **LineSpacing**: Specifies the value for the space between the lines.

* **LineSpacingType**: Specifies the type of spacing:

  * **AtLeast**: The space between the lines should equal or greater than the value of the **LineSpacing** property.

  * **Auto**: The space between the lines is determined automatically.

  * **Exact**: The space between the lines should equal to the value of the **LineSpacing** property.

* **LeftIndent**: Represents the size of the indent to the left size of the **Paragraph**. The indent gets applied together with the respective margins to the layout.

* **RightIndent**: Represents the size of the indent to the right size of the **Paragraph**. The indent gets applied together with the respective margins to the layout.

* **SpacingAfter**: Represents the size of the empty space after the **Paragraph**.

* **SpacingBefore**: Represents the size of the empty space before the **Paragraph**.

* **TextAlignment**: Represents the alignment of the text inside the **Paragraph**.

* **SuppressLineNumbers**: Gets or sets a boolean value indicating whether the line numbering for the current **Paragraph** is suppressed.

## See Also

* [Elements Hierarchy](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-hierarchy)
* [RadDocument](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-raddocument)
* [Section](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-section)
* [Span](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-span)
* [Hyperlink](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/features/document-elements-hyperlink)
* [InlineImage](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/document-elements/features-inlineimage)
