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

# How to group and lay out your inputs

> Putting inputs under a heading with group, sharing a row with inline, adding help text with tooltip, and choosing from a list with options.

Every input function takes the same layout arguments after its value and title: `group`, `inline`, `tooltip` and `confirm`. Give two
inputs the same `group` string and they sit under one heading; give them the same `inline` string and they share a row. The strings
are `const`: they cannot be built from series values (see [const, input, simple and series](https://gocharting.com/docs/scripting/language/qualifiers.md)).

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Grouped inputs", overlay=true)
src = input.source(close, "Source", inline="calc", group="Calculation")
length = input.int(20, "Length", minval=1, maxval=200, step=1, tooltip="Bars in the average", inline="calc", group="Calculation")
up = input.color(color.green, "Rising", group="Appearance")
down = input.color(color.red, "Falling", group="Appearance")
average = talib.sma(src, length)
plot(average, title="Average", color=close > close[1] ? up : down)
```

`input.int` and `input.float` also take `minval`, `maxval` and `step`; `step` may be named like any other argument. The text of
`tooltip` shows on hover, and the `inline` string itself is never displayed. With `confirm=true` the reader is asked to confirm the value before the script is added to the chart (default `false`).

## Choose from a list

`input.string`, `input.int` and `input.float` take `options`, a bracketed list of the allowed values. The default must be one of them, whatever its type.

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Average type", overlay=true)
kind = input.string("EMA", "Type", options=["SMA", "EMA"])
length = input.int(20, "Length", minval=1)
plot(kind == "EMA" ? talib.ema(close, length) : talib.sma(close, length), title="Average")
```

## The mistake to avoid

> [!WARNING]
>
> Building a layout string from a series value. The compiler says: Cannot call `input.int` with argument `group`=`str.tostring(bar_index)`. An argument of `series string` type was used but a `const string` is expected.
>
> ```lipi-invalid theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
> //@lipi=2
> indicator("Series group", overlay=true)
> length = input.int(20, "Length", group=str.tostring(bar_index))
> plot(talib.sma(close, length))
> ```

The editor's check reports it. See [Inputs](https://gocharting.com/docs/scripting/configuration/inputs.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.