Client

dialog

fjsf.dialog(title, description, cancel, content, data)

Opens an input dialog rendered in NUI and waits for user input.


Parameters

  • title string Dialog title displayed at the top.

  • description string | nil Optional description text below the title.

  • cancel boolean If true, shows a Cancel button. If false, only the Confirm button is shown.

  • content table Array of input definitions. Each item defines one input field.


Supported input types

type = "input"

  • label string

  • placeholder string

  • default string

  • password boolean

  • required boolean

  • disabled boolean

  • min number (minlength)

  • max number (maxlength)

  • icon string | nil

  • iconAnim string | nil

type = "number"

  • label string

  • default number

  • min number

  • max number

  • step number

  • required boolean

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil

type = "checkbox"

  • label string

  • default boolean

  • required boolean

  • disabled boolean

type = "select"

  • label string

  • placeholder string | nil

  • options table { label = string, value = any }

  • default any

  • required boolean

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil

type = "multiselect"

  • label string

  • placeholder string | nil

  • options table

  • default table | nil

  • max number | nil

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil

type = "slider"

  • min number

  • max number

  • step number

  • default number

  • disabled boolean

type = "color"

  • default string (hex color, e.g. #ff0000)

  • icon string | nil

  • iconAnim string | nil

type = "date"

  • default string | boolean

  • min string

  • max string

  • format string

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil

type = "time"

  • default string

  • min string

  • max string

  • format string

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil

type = "textarea"

  • default string

  • placeholder string

  • minLength number

  • maxLength number

  • autosize boolean

  • required boolean

  • disabled boolean

  • icon string | nil

  • iconAnim string | nil


iconAnim

Defines the animation applied to the input icon. This parameter is purely visual and has no effect on logic or validation.

Type: string | nil

If omitted, the icon is static.

Allowed values

  • spin – continuous clockwise rotation

  • spinReverse – continuous counter-clockwise rotation

  • spinSlow – slow rotation

  • spinPulse – rotation with scale pulse

  • pulse – smooth scale in/out

  • beat – fast heartbeat scale

  • beatFade – beat with opacity fade

  • fade – fade in/out

  • blinkSoft – soft blinking

  • bounce – vertical bounce

  • float – gentle floating motion

  • orbit – small orbital rotation

  • shake – horizontal shake

  • wiggle – rotational wiggle

  • tick – quick ticking scale

  • tiltBreath – slow tilt + scale

  • scan – side-to-side scan

  • polarFloat – irregular floating motion

Invalid values are ignored by the UI.


data

  • blur boolean Enables background blur.

  • sounds boolean Enables sound effects.

  • size string Dialog size. Allowed values:

    • small

    • medium

    • large


Returns

  • table | nil Array of input values in the same order as content, or nil if the dialog was cancelled.


Example


closeDialog

Closes the dialog manually.


Parameters

  • result any | nil Result value returned to the dialog handler.


Returns

This function does not return anything.


Example

Last updated