Appearance
In this article, you will find information about the styling options and rendering of the Telerik UI for ASP.NET Core TextBox.
For a live example, refer to the Appearance Demo of the TextBox.
Options
The TextBox HtmlHelper provides the following styling options:
-
Size()
—configures the overall size of the component. -
FillMode()
—defines how the color is applied to the component. -
Rounded()
—specifies the border radius of the component.
Size
The Size()
method controls the size of the rendered TextBox.
The example below demonstrates how to adjust the Size
of the component:
@(Html.Kendo().TextBox()
.Name("textbox")
.Size(ComponentSize.Medium)
)
<kendo-textbox name="textbox"
size="ComponentSize.Medium">
</kendo-textbox>
The following values are available for the Size
option:
Small
Medium
Large
None
The default size value is Medium
and it is applied to the wrapping span element through the k-input-md
class.
<span class="k-textbox k-input k-input-md">
</span>
Rounded
The border radius of the TextBox can be customized through the Rounded()
method.
@(Html.Kendo().TextBox()
.Name("textbox")
.Rounded(Rounded.Medium)
)
<kendo-textbox name="textbox"
rounded="Rounded.Medium">
</kendo-textbox>
The following values are available for the Rounded
option:
Small
Medium
Large
Full
None
The default value is Medium
and it is added as a class k-rounded-md
to the wrapping span element.
<span class="k-textbox k-input k-rounded-md">
</span>
FillMode
The FillMode()
method controls the way the color is applied to the TextBox component.
@(Html.Kendo().TextBox()
.Name("textbox")
.FillMode(FillMode.Solid)
)
<kendo-textbox name="textbox"
fill-mode="FillMode.Solid">
</kendo-textbox>
The following values are available for the FillMode
option:
Solid
Flat
Outline
None
The default FillMode
value is Solid
and it is applied to the wrapping span element through the k-input-solid
class.
<span class="k-textbox k-input k-input-solid">
</span>
Rendering
Starting with version R1 2022, the component has a new rendering. For additional information on the decision behind these changes, visit the Components Rendering Overview article.
To review the latest rendering of the component, refer to the HTML specifications in the Kendo UI Themes Monorepo. The tests
folder of the repository contains the rendering for all flavors of the components, providing a clear reference for how their elements are structured. The rendering information can help you customize a component's appearance and behavior by applying custom CSS or JavaScript to suit specific design or functional requirements.