Modals are small, focused UI flows. Use them for confirmations, forms, and multi-step flows. Simple to use, but capable of handling more complex interactions when needed.Documentation Index
Fetch the complete documentation index at: https://sphere.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Creating
Output
Output
FooterButtons Table
The footer button definitions. Modify before calling
The resolved values from all UI elements, keyed by their
Bindable events for the modal lifecycle.Stack Table • Read-Only
The current page stack. Shared with child modals pushed via
The footer button definitions. Modify before calling
:Show(). See Footer Buttons.Results TableThe resolved values from all UI elements, keyed by their
UniqueId.Events Table • Read-OnlyBindable events for the modal lifecycle.Stack Table • Read-Only
The current page stack. Shared with child modals pushed via
:Push().Internal Read-Only- UniqueId String
Auto-generated GUID used to identify this modal instance. - RuleSet Table
All registered validation rules. Populated by:AddRule(). - Layout Table
The page and element definitions built by:Page(),:Add(), and:Grid().
Layout
Page
Pages are steps in the modal. Use multiple pages for wizards or multi-step flows.Annotation
Annotation
Input
Input
Index Number?
The page to retrieve by index.
The page to retrieve by index.
Add
Adds a full-width block element to the page. Pass a type string for preset components or a RobloxInstance to parent it directly into the modal.
Annotation
Annotation
Input
Input
Type String | Instance • Required
Any
Type-specific configuration fields. Not available on raw Instance elements.UniqueId String
Key used to store this element’s value in
Any
Instance parents directly into the modal and does not expose UIFlexMode, Config or Execute.Config LabelType-specific configuration fields. Not available on raw Instance elements.UniqueId String
Key used to store this element’s value in
Modal.Results. Omit for display-only elements.Output
Output
UIFlexMode Enum
Controls how the element stretches inside its container. See UIFlexMode.Config Table
Type-specific configuration fields. Not available on raw Instance elements.Execute Function
Called when the element’s value changes. Not available on raw Instance elements.
Controls how the element stretches inside its container. See UIFlexMode.Config Table
Type-specific configuration fields. Not available on raw Instance elements.Execute Function
Called when the element’s value changes. Not available on raw Instance elements.
Grid
Adds elements using a coordinate system, enabling inline multi-column layouts. Grids can be nested.Annotation
Annotation
Input
Input
Position Vector2 • Required
The column/row coordinate for this element inside the grid.Callback Function • Required
The column/row coordinate for this element inside the grid.Callback Function • Required
add and recursive grid function.Groups
Groups link multiple selection elements together. Works withToggleButtons, CheckBoxes, RadioButtons, and PillButtons.
Element.Config.Group on each element that should participate.
Annotation
Annotation
Input
Input
UniqueId String • Required
The key used to store the group’s result in
When
Minimum number of selections required before the modal can be submitted.Limit Number
Maximum number of selections allowed in the group.
The key used to store the group’s result in
Modal.Results.Exclusive BooleanWhen
true, only one option in the group can be selected at a time.Required NumberMinimum number of selections required before the modal can be submitted.Limit Number
Maximum number of selections allowed in the group.
Footer Buttons
The footer renders action buttons at the bottom of the modal. The defaults areCancel and Submit, in that order. Modify Modal.FooterButtons before calling :Show().
Both
Submit and Cancel can be modified or removed.When a modal is displayed via
:Push(), the Cancel button is automatically relabeled to Back. There is no need to define a separate Back button.Annotation
Annotation
Input
Input
UniqueId String • Required
Unique identifier for the button. Use
The label shown on the button.Type String • Required
Visual style. Accepted values:
The position of the button in the footer row. Lower numbers appear first.Callback Function • Required
Called when the button is pressed.
Unique identifier for the button. Use
"submit" to mark the button that triggers validation.Title String • RequiredThe label shown on the button.Type String • Required
Visual style. Accepted values:
Primary, Secondary, Danger.Order Number • RequiredThe position of the button in the footer row. Lower numbers appear first.Callback Function • Required
Called when the button is pressed.
Validation only runs on buttons whose
UniqueId is "submit".Validation
AddRule
Registers a validation function that runs before the modal can be submitted. All rules must returntrue for submission to proceed.
Annotation
Annotation
Input
Input
Rule Function • Required
Receives the current
Receives the current
Results table. Return true to allow submission, false to block it.Resolve
Manually triggers all registered validation rules and fires theValidate event.
Displaying a modal
Results will be
nil if the modal is cancelled.Show
Displays the modal and returns a handle with anOnComplete signal.
Annotation
Annotation
Output
Output
OnComplete RBXScriptSignal • Read-Only
Fires when the modal is resolved. Passes the
Fires when the modal is resolved. Passes the
Results table to connected callbacks.Push
Pushes a child modal on top of the current one. The child shares the same stack. The cancel button becomes Back, and the parent resumes when the child resolves.Annotation
Annotation
Input
Input
Modal String | Modal • Required
A template name string or an existing
Optional parameters forwarded to the template function.
A template name string or an existing
Modal instance to push onto the stack.… AnyOptional parameters forwarded to the template function.
Output
Output
OnComplete RBXScriptSignal • Read-Only
Fires when the pushed modal resolves. The parent modal then resumes.
Fires when the pushed modal resolves. The parent modal then resumes.
Templates
Templates let you define reusable modal layouts and register them by name.Register
Annotation
Annotation
Input
Input
Name String • Required
The key used to reference this template when importing or pushing.Builder Function • Required
A function that receives optional params and returns a fully configured
The key used to reference this template when importing or pushing.Builder Function • Required
A function that receives optional params and returns a fully configured
Modal instance.Import
Retrieves a registered template and returns a configuredModal instance.
Annotation
Annotation
Input
Input
Name String • Required
The name of the registered template to import.… Any
Optional parameters forwarded to the template’s builder function.
The name of the registered template to import.… Any
Optional parameters forwarded to the template’s builder function.
Output
Output
Modal Modal
The configured modal instance returned by the builder. Returns
The configured modal instance returned by the builder. Returns
nil if the template name is not found.Results
Results are populated when the modal resolves. You can access them two ways.Event
Use this when you want to react immediately after the modal closes.Property
Use this to read the results any time after the modal completes, as long as it hasn’t been destroyed.You can also write to
Modal.Results manually to pre-populate or override values.