# Input

<figure><img src="/files/ncYgufzVclfvvZRxArn7" alt=""><figcaption></figcaption></figure>

```lua
Section:Input({
  Name <string>
  Placeholder <string>
  AcceptedCharacters <function or string: "All", "Numeric", "Alphabetic", "AlphaNumeric">
  Callback <function(): string> -- Called upon focus lost
  onChanged <function(): string> -- Called upon text changed
}, <string or nil> Flag)
```

Functions

```lua
:UpdateName(<string>)
:SetVisiblity(<boolean>)
:GetInput(: string)
:UpdatePlaceholder(<string>)
:UpdateText(<string>)

.Text : string
.IgnoreConfig <boolean>
.Settings : table -- Not everything may be updated, but Callback should be correct.
```

Example

```lua
sections.MainSection1:Input({
	Name = "Target",
	Placeholder = "Username",
	AcceptedCharacters = "All",
	Callback = function(input)
		print("Target set: ".. input)
	end,
}, "TargetInput")
```

Example using custom AcceptedCharacters filter

```lua
sections.MainSection1:Input({
	Name = "Target",
	Placeholder = "Username",
	AcceptedCharacters = function(input)
		return input:gsub("[^a-zA-Z0-9]", "") -- AlphaNumeric sub
	end,
	Callback = function(input)
		print("Target set: ".. input)
	end,
}, "TargetInput")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://brady-xyz.gitbook.io/maclib-ui-library/getting-started/loading-maclib/creating-a-window/creating-a-tab-group/adding-tabs/adding-sections/input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
