> ## Documentation Index
> Fetch the complete documentation index at: https://calcs.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Input Widget

> Primary user input field for data entry in Calcs.com templates

## Widget Core Function

The input widget is the primary user input field. It will output (by default) an empty box/cell that requires user input for some calculations. Behaves similarly to a cell in Microsoft Excel.

### UI Experience

* Primary user input field
* Outputs an empty box/cell for user data entry
* Accepts numerical values, text, or formulas

### Data Organization

* Behaves similarly to a cell in Microsoft Excel
* Can store and reference values throughout the template

<Note>
  [Watch the tutorial: Create an Input Widget](https://www.loom.com/share/94e707d9cc1f44fdb31ab661bc43e6f9)
</Note>

## Visual Presentation

Because the input widget is fairly simple and is only an interface for the user to input data, there is no specific section associated to the core functions in the widget. Any section used in the input widget is used in other widgets as well.

## Example Code

```json theme={null}
{
  "type": "sheetTemplateWidgets",
  "attributes": {
    "type": "input",
    "label": "Cross-section Width",
    "symbol": "b",
    "units": "mm",
    "export": false,
    "visibleIf": "",
    "checks": [],
    "defaultValue": "300",
    "referenceId": "width",
    "references": "AS4100:2020 Cl 5.1",
    "description": "Width of the cross-section",
    "authorNotes": "Standard width input"
  }
}
```

## Parameters

| Key              | Type           | Default | Required | Description              |
| ---------------- | -------------- | ------- | -------- | ------------------------ |
| `type`           | string         | -       | Yes      | Must be "input"          |
| `label`          | string         | -       | Yes      | The name of widget       |
| `symbol`         | string (KaTeX) | -       | Yes      | Symbol for the widget    |
| `units`          | string         | -       | No       | Units for the widget     |
| `referenceId`    | string         | -       | Yes      | Unique reference ID      |
| `export`         | boolean        | false   | No       | Export for load linking  |
| `visibleIf`      | string         | true    | No       | Visibility condition     |
| `checks`         | array          | \[]     | No       | Validation checks        |
| `defaultValue`   | string         | -       | No       | Default value or formula |
| `description`    | string         | -       | No       | User-facing description  |
| `references`     | string         | -       | Yes      | Code/standard reference  |
| `authorNotes`    | string         | -       | No       | Internal notes           |
| `referenceImage` | string         | -       | No       | Supporting image         |

## Common Use Cases

### Basic Numerical Input

```json theme={null}
{
  "type": "input",
  "label": "Length",
  "symbol": "L",
  "units": "m",
  "defaultValue": "3.0",
  "referenceId": "length"
}
```

### Text Input

```json theme={null}
{
  "type": "input",
  "label": "Project Name",
  "symbol": "",
  "units": "",
  "referenceId": "projectName"
}
```

### Conditional Visibility

```json theme={null}
{
  "type": "input",
  "label": "Wind Load",
  "symbol": "W",
  "units": "kPa",
  "visibleIf": "includeWind == true",
  "referenceId": "windLoad"
}
```

## Validation Checks

Input widgets can include validation checks to ensure data quality:

```json theme={null}
{
  "checks": [
    {
      "condition": "width > 0",
      "message": "Width must be positive"
    },
    {
      "condition": "width <= 1000",
      "message": "Width exceeds maximum allowed (1000mm)"
    }
  ]
}
```

## Best Practices

<Tip>
  * Use clear, descriptive labels
  * Include appropriate units
  * Set sensible default values
  * Add validation checks for critical inputs
  * Use visibility conditions to simplify the interface
  * Include references to relevant standards
</Tip>

## Examples from Current Calculators

| ReferenceId | Calculator                                                                                                                            |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `alpha_v`   | [EU Steel Column](https://calcs.com/organisation/2ad7e5c6-8d23-416d-acb1-5487dc65150a/templates/6d7fc7ed-f6f7-4392-822b-cdee58bab93b) |
