Skip to content

Commit 7fec35b

Browse files
committed
997757: Need to provide documentation for the line height feature
1 parent d56fae6 commit 7fec35b

File tree

7 files changed

+89
-0
lines changed

7 files changed

+89
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
public class HomeController : Controller
2+
{
3+
public ActionResult Index()
4+
{
5+
ViewBag.value = @"<p>The Rich Text Editor allows users to apply line-height (line-spacing) to elements like paragraphs, lists, headings, and table cells. You can set line height using a dedicated dropdown in the toolbar, and it is applied as inline style to the selected blocks. This feature makes text easier to read and gives better control over content layout.</p><p><b> Key features:</b></p> <ul> <li><p>Provides a <b>Line Height</b> dropdown in the toolbar for easy access.</p></li><li><p>Supports applying line-height to paragraphs, headings, lists, and table cells.</p></li><li><p>Applies line-height as inline styles for consistent and precise text rendering.</p></li><li><p>Ensures consistent appearance across devices and print layouts.</p></li><li><p>Improves text readability and overall document aesthetics.</p></li></ul>";
6+
object size1 = new
7+
{
8+
text = "8 px",
9+
value = "8px"
10+
};
11+
object size2 = new
12+
{
13+
text = "10 px",
14+
value = "10px"
15+
};
16+
object size3 = new
17+
{
18+
text = "12 px",
19+
value = "12px"
20+
};
21+
object size4 = new
22+
{
23+
text = "14 px",
24+
value = "14px"
25+
};
26+
object size5 = new
27+
{
28+
text = "42 px",
29+
value = "42px"
30+
};
31+
32+
ViewBag.items = new[] { "LineHeight" };
33+
ViewBag.LineHeightItems = new[] { size1, size2, size3, size4, size5 };
34+
return View();
35+
}
36+
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Html.EJS().RichTextEditor("custom-line-height").ToolbarSettings(e => e.Items((object)ViewBag.items)).LineHeight(t => t.Default("10px").SupportAllValues(true).Items(ViewBag.LineHeightItems)).Value(ViewBag.value).Render()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ejs-richtexteditor id="custom-line-height" value="@ViewBag.value">
2+
<e-richtexteditor-lineheight default="10 px" items="@ViewBag.LineHeightItems" supportAllValues="true">
3+
</e-richtexteditor-lineheight>
4+
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
5+
</ejs-richtexteditor>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public class HomeController : Controller
2+
{
3+
public ActionResult Index()
4+
{
5+
ViewBag.value = @"<p>The Rich Text Editor allows users to apply line-height (line-spacing) to elements like paragraphs, lists, headings, and table cells. You can set line height using a dedicated dropdown in the toolbar, and it is applied as inline style to the selected blocks. This feature makes text easier to read and gives better control over content layout.</p><p><b> Key features:</b></p> <ul> <li><p>Provides a <b>Line Height</b> dropdown in the toolbar for easy access.</p></li><li><p>Supports applying line-height to paragraphs, headings, lists, and table cells.</p></li><li><p>Applies line-height as inline styles for consistent and precise text rendering.</p></li><li><p>Ensures consistent appearance across devices and print layouts.</p></li><li><p>Improves text readability and overall document aesthetics.</p></li></ul>";
6+
ViewBag.items = new[] { "LineHeight" };
7+
return View();
8+
}
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Html.EJS().RichTextEditor("line-height").ToolbarSettings(e => e.Items((object)ViewBag.items)).Value(ViewBag.value).Render()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<ejs-richtexteditor id="line-height" value="@ViewBag.value">
2+
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
3+
</ejs-richtexteditor>

ej2-asp-core-mvc/rich-text-editor/EJ2_ASP.MVC/tools/text-formatting.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,39 @@ While the toolbar does not provide a direct method to apply blockquote formattin
463463
{% endtabs %}
464464
{% endif %}
465465

466+
## Line Height
467+
468+
The Rich Text Editor supports line height feature which allows users to adjust the vertical spacing between lines of text. To change the line height, select the text you want to modify and click the Line Height icon in the toolbar. Choose from the available spacing options to apply the desired vertical spacing. This feature is especially useful for creating visually appealing paragraphs and ensuring consistent formatting across your document.
469+
470+
### Built-in line height
471+
472+
You can add the `LineHeight` tool to the toolbar in the Rich Text Editor using [toolbarSettings.items](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.RichTextEditor.RichTextEditor.html#items) property.
473+
474+
{% if page.publishingplatform == "aspnet-core" %}
475+
476+
{% tabs %}
477+
{% highlight cshtml tabtitle="CSHTML" %}
478+
{% include code-snippet/rich-text-editor/line-height/tagHelper %}
479+
{% endhighlight %}
480+
{% highlight c# tabtitle="Controller.cs" %}
481+
{% include code-snippet/rich-text-editor/line-height/controller.cs %}
482+
{% endhighlight %}
483+
{% endtabs %}
484+
485+
{% elsif page.publishingplatform == "aspnet-mvc" %}
486+
487+
{% tabs %}
488+
{% highlight razor tabtitle="CSHTML" %}
489+
{% include code-snippet/rich-text-editor/line-height/razor %}
490+
{% endhighlight %}
491+
{% highlight c# tabtitle="Controller.cs" %}
492+
{% include code-snippet/rich-text-editor/line-height/controller.cs %}
493+
{% endhighlight %}
494+
{% endtabs %}
495+
{% endif %}
496+
497+
The Rich Text Editor comes with a pre-configured set of [`lineHeight`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.RichTextEditor.RichTextEditor.html#lineheight) property.
498+
466499
## Horizontal line
467500

468501
The Rich Text Editor enables users to insert horizontal dividers using the `HorizontalLine` tool available in the toolbar. Horizontal lines (<hr>) help visually separate sections of content, enhancing readability and structural clarity.

0 commit comments

Comments
 (0)