Checkbox

Extends ButtonBase
Namespace Limbo.Forms.Models.Fields
Type checkbox

The Checkbox class represents a single checkbox similar to writing <input type="checkbox" /> in HTML.

Properties

The class has the following properties:

C# Name C# Type JSON Name Description
Type string type Inherited from the FieldBase class.
The type of the field - generally matching the HTML type attribute, or a custom value for non-HTML fields.
Name string name Inherited from the FieldBase class.
The name of the field - matching the value for the HTML `name` attribute.
Label string label Inherited from the FieldBase class.
A friendly name that should accompany the field.
Description string description Inherited from the FieldBase class.
A description that should accompany the field.
IsRequired bool required Inherited from the FieldBase class.
Whether the field is required/mandatory.
Value object value Inherited from the FieldBase class.
An optional value of the field.
IsChecked bool checked A boolean value indicating whether the checkbox should initially be checked.

JSON Output

{
  "type": "checkbox",
  "name": "iCanHasBacon",
  "label": "I can has bacon?",
  "description": "A description about whether Bjerner absolutely should have bacon (he should).",
  "checked": true,
  "required": true,
  "value": "yup"
}