Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sure-developer.com/llms.txt

Use this file to discover all available pages before exploring further.

Input

Input renders a single-line text input. It sends a payload with value = string to Lua whenever the value changes.
local search, setSearch = track.state('search', '')

lui.page('search', function(ui)
  ui.input({
    placeholder = 'Search item',
    prefixIconComponent = 'lucide:search',
    suffix = 'esc',
    value = search,
    onChange = function(payload)
      setSearch(payload.value)
    end
  })
end)

API

ui.input(props)

Props

PropTypeDescription
valuestring | reactive getterCurrent input value.
placeholderstringPlaceholder text.
onChangefunction(payload)Receives a payload with value = string.
prefix, prefixIcon, prefixIconComponenticonLeading content or Iconify icon.
suffix, suffixIcon, suffixIconComponenticonTrailing content or Iconify icon.
startIcon, startIconComponent, icon, iconComponenticonAlternative leading icon props.
endIcon, endIconComponenticonAlternative trailing icon props.
wrapperClassNamestringClass for the outer label wrapper.
inputClassNamestringClass for the input element.
prefixClassName, suffixClassName, iconClassNamestringClasses for icon slots.
className, stylemixedCommon LUI styling props.
The renderer uses defaultValue, so keep reactive state in Lua as the source of truth and update it from onChange.