|
| 1 | +@page "/text-area-input" |
| 2 | + |
| 3 | +@attribute [Route(pageUrl)] |
| 4 | + |
| 5 | +<PageMetaTags PageUrl="@pageUrl" |
| 6 | + Title="@metaTitle" |
| 7 | + Description="@metaDescription" |
| 8 | + ImageUrl="@imageUrl" /> |
| 9 | + |
| 10 | +<PageHero Heading="@pageTitle"> |
| 11 | + <LeadSection>@pageDescription</LeadSection> |
| 12 | +</PageHero> |
| 13 | + |
| 14 | +<CarbonAds /> |
| 15 | + |
| 16 | +<Section Size="HeadingSize.H2" Name="Basic usage" PageUrl="@pageUrl" Link="basic-usage"> |
| 17 | + <Demo Type="typeof(TextAreaInput_Demo_01_Basic_Usage)" Tabs="true" /> |
| 18 | +</Section> |
| 19 | + |
| 20 | +<Section Size="HeadingSize.H2" Name="Text alignment" PageUrl="@pageUrl" Link="text-alignment"> |
| 21 | + <div class="mb-3">You can change the text alignment according to your need. Use the <code>TextAlignment</code> parameter to set the alignment. In the below example, alignment is set to center and end.</div> |
| 22 | + <Demo Type="typeof(TextAreaInput_Demo_02_Text_Alignment)" Tabs="true" /> |
| 23 | +</Section> |
| 24 | + |
| 25 | +<Section Size="HeadingSize.H2" Name="Disable" PageUrl="@pageUrl" Link="disable"> |
| 26 | + <div class="mb-3">Use the <code>Disabled</code> parameter to disable the <code>TextAreaInput</code>.</div> |
| 27 | + <Demo Type="typeof(TextAreaInput_Demo_03_Disable_A)" Tabs="false" /> |
| 28 | + <div class="my-3">Also, use <b>Enable()</b> and <b>Disable()</b> methods to enable and disable the <code>TextAreaInput</code>.</div> |
| 29 | + <Callout Color="CalloutColor.Warning" Heading="NOTE"> |
| 30 | + Do not use both the <b>Disabled</b> parameter and <b>Enable()</b> & <b>Disable()</b> methods. |
| 31 | + </Callout> |
| 32 | + <Demo Type="typeof(TextAreaInput_Demo_03_Disable_B)" Tabs="false" /> |
| 33 | +</Section> |
| 34 | + |
| 35 | +<Section Size="HeadingSize.H2" Name="Max length" PageUrl="@pageUrl" Link="max-length"> |
| 36 | + <Demo Type="typeof(TextAreaInput_Demo_04_MaxLength)" Tabs="true" /> |
| 37 | +</Section> |
| 38 | + |
| 39 | +<Section Size="HeadingSize.H2" Name="Valdations" PageUrl="@pageUrl" Link="validations"> |
| 40 | + <div class="mb-3"> |
| 41 | + Like any other blazor input component, <code>TextAreaInput</code> supports validations. |
| 42 | + Add the DataAnnotations on the <code>TextAreaInput</code> component to validate the user input before submitting the form. |
| 43 | + In the below example, we used <b>Required</b> attribute. |
| 44 | + </div> |
| 45 | + <Demo Type="typeof(TextAreaInput_Demo_05_Validations)" Tabs="true" /> |
| 46 | +</Section> |
| 47 | + |
| 48 | +<Section Size="HeadingSize.H2" Name="Events: ValueChanged" PageUrl="@pageUrl" Link="events-value-changed"> |
| 49 | + <div class="mb-3">This event fires when the <code>TextAreaInput</code> value changes, but not on every keystroke.</div> |
| 50 | + <Demo Type="typeof(TextAreaInput_Demo_06_Events_ValueChanged)" Tabs="true" /> |
| 51 | +</Section> |
| 52 | + |
| 53 | +@code { |
| 54 | + private const string pageUrl = RouteConstants.Demos_TextAreaInput_Documentation; |
| 55 | + private const string pageTitle = "Blazor TextAreaInput"; |
| 56 | + private const string pageDescription = "The Blazor Bootstrap TextAreaInput component provides a multi-line plain-text editing control, ideal for scenarios requiring users to input substantial amounts of free-form text. Common use cases include comment sections on reviews or feedback forms."; |
| 57 | + private const string metaTitle = "Blazor TextAreaInput Component"; |
| 58 | + private const string metaDescription = "The Blazor Bootstrap TextAreaInput component provides a multi-line plain-text editing control, ideal for scenarios requiring users to input substantial amounts of free-form text. Common use cases include comment sections on reviews or feedback forms."; |
| 59 | + private const string imageUrl = "https://i.imgur.com/1mVjqQv.png"; // TODO: Update image URL |
| 60 | +} |
0 commit comments