🚀
Maclib UI Library
  • Information
    • Welcome
    • Documentation Formatting
    • Miscellaneous
  • Getting Started
    • Loading Maclib
      • Creating a window
        • Adding a Global Setting
        • Displaying a notification
        • Prompting a dialog
        • Creating a tab group
          • Adding tabs
            • Adding sections
              • Button
              • Input
              • Slider
              • Toggle
              • Keybind
              • Colorpicker
              • Dropdown
              • Header
              • Paragraph
              • Label
              • Sub Label
              • Divider
              • Spacer
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started
  2. Loading Maclib
  3. Creating a window
  4. Creating a tab group
  5. Adding tabs
  6. Adding sections

Input

PreviousButtonNextSlider

Last updated 7 months ago

Was this helpful?

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

: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

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

Example using custom AcceptedCharacters filter

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")