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

# Inputs

> Collect text with standard submit inputs or toggle inputs.

`AddInput()` creates a text box paired with an action button. `AddTextBox()` and `AddTextbox()` are exact aliases of the same builder.

## Standard input

```lua theme={null}
local input = tab:AddInput({
	Info = {
		Title = "Message",
		Description = "Text sent to the callback.",
	},
	DefaultText = "Hello",
	InternalInfo = {
		UniqueCommandId = "message",
		Aliases = { "msg" },
	},
	Callback = function(text)
		print("Message:", text)
	end,
})
```

Clicking the action button calls `Callback(text)`. Pressing **Enter** in the text box also submits the current text.

## Toggle input

Set `InternalInfo.Toggle = true` to use the adjacent button as a boolean toggle:

```lua theme={null}
tab:AddInput({
	Info = {
		Title = "Prefix",
		Description = "Enable a custom chat prefix.",
	},
	DefaultText = "[VIP]",
	InternalInfo = {
		Toggle = true,
		UniqueCommandId = "prefix",
		Aliases = { "tag" },
	},
	Callback = function(enabled, text)
		print(enabled, text)
	end,
})
```

Toggle callbacks receive **two arguments**: `Callback(state, text)`.

The behavior is:

| Action | Callback |
| :- | :- |
| Click toggle button | `Callback(newState, currentText)` |
| Press Enter while enabled | `Callback(true, currentText)` |
| Press Enter while disabled | No callback execution |

## Rich text

The action title and its description tooltip support Roblox rich-text markup by
default:

```lua theme={null}
tab:AddInput({
	Info = {
		Title = "<b>Message</b>",
		Description = "<font color=\"#9D7BFF\">Enter a message.</font>",
	},
})
```

Set `RichText = false` on the input config or inside `Info` to opt out.

## Configuration

**Info.Title** `string` (default: "Submit" (or "Toggle"))

Text displayed on the action half of the control.

**Info.Description** `string`

Tooltip text displayed instantly while hovering the action area. Use `\n` for line breaks.

**RichText** `boolean` (default: true)

Enables rich-text markup for the action title and description tooltip. Set to `false`
to opt out. `Info.RichText` is also accepted.

**DefaultText** `string` (default: "")

Initial textbox value.

**InternalInfo.Toggle** `boolean` (default: false)

Enables two-argument toggle behavior.

**InternalInfo.UniqueCommandId** `string`

Stable Quick Commands ID. A random ID is generated when omitted.

**InternalInfo.Bindable** `boolean` (default: false)

Adds a right-click menu for assigning or removing a keyboard shortcut.

**InternalInfo.StartupAvailable** `boolean` (default: false)

Adds a persisted startup flag to the context menu. The current input implementation does not execute the input callback automatically from that flag on startup.

**Aliases** `string[]`

Alternate Quick Commands names. `Info.Aliases` and `InternalInfo.Aliases` are also accepted.

**Callback** `function`

Standard input: `Callback(text)`. Toggle input: `Callback(state, text)`.

## Quick Commands

Standard input concatenates all arguments into the textbox value:

```text theme={null}
message hello from quick commands
```

Toggle input supports an optional state prefix:

```text theme={null}
prefix on [VIP]
prefix off [VIP]
prefix [VIP]
```

The explicit forms `on`, `true`, `1`, `off`, and `false` are recognized. Without a state prefix, the supplied arguments replace the textbox text and enable the toggle.

## Returned handle

```lua theme={null}
local input = tab:AddInput({
	Info = { Title = "Message" },
	Callback = function(text)
		print(text)
	end,
})

print(input:getId())
print(input:getValue())
print(input:isToggled())
```

| Method | Result |
| :- | :- |
| `getValue()` | Current textbox text. |
| `getId()` | Resolved command ID. |
| `isToggled()` | `true` only when the input is a toggle whose stored state is enabled. |

## Aliases

These three builders are equivalent:

```lua theme={null}
tab:AddInput(config)
tab:AddTextBox(config)
tab:AddTextbox(config)
```


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