Label and Size in Check Box Control

19 Dec 20221 minute to read

This section explains the different sizes and labels.

Label

The CheckBox caption can be defined by using the Label property. This reduces the manual addition of label for CheckBox. You can customize the label position before or after the CheckBox through the LabelPosition property.

@Html.EJS().CheckBox("cbox1").Label("Left Side Label").LabelPosition(Syncfusion.EJ2.Buttons.LabelPosition.Before).Render()
@Html.EJS().CheckBox("cbox2").Label("Right Side Label").LabelPosition(Syncfusion.EJ2.Buttons.LabelPosition.After).Render()

<style>

.e-checkbox-wrapper {
  margin-top: 18px;
}

li {
  list-style: none;
}

</style>
public ActionResult Label()
{
    return View();
}

Size

The different CheckBox sizes available are default and small. To reduce the size of default CheckBox to small, set the CssClass property to e-small.

@Html.EJS().CheckBox("cbox1").Label("Small").CssClass("e-small").Render()
@Html.EJS().CheckBox("cbox2").Label("Default").Render()


<style>

.e-checkbox-wrapper {
  margin-top: 18px;
}

li {
  list-style: none;
}

</style>
public ActionResult Size()
{
    return View();
}

NOTE

View Sample in GitHub.

See also