Mobile Widgets

Complete reference for all 28 mobile widgets

Mobile Widgets Reference

Mobile widgets are optimized for touch devices with responsive layouts and gesture support. All 28 mobile widgets are prefixed with "M" and designed specifically for iOS and Android applications. This reference documents all mobile widgets with their properties, events, methods, and usage examples.

Container Widgets

MView

Mobile view container - the primary container for mobile screens.

Properties

PropertyTypeDescription
scrollableBooleanEnable scrolling
pullToRefreshBooleanPull-to-refresh gesture
headerObjectView header configuration
footerObjectView footer configuration

Events

EventDescription
ViewLoadView loaded
PullToRefreshPull to refresh triggered
OrientationAlteredDevice orientation changed

Methods

MethodDescriptionReturns
addChild(widget)Add child widget to viewvoid
removeChild(widget)Remove child widgetvoid
enablePullToRefresh(enabled)Enable/disable pull to refreshvoid
scrollTo(position)Scroll to positionvoid

MDialog

Mobile modal dialog for alerts, confirmations, and forms.

Properties

PropertyTypeDescription
titleStringDialog title
fullscreenBooleanFull screen mode
dismissibleBooleanTap outside to close

Methods

MethodDescriptionReturns
show()Show modal dialogvoid
hide()Hide modal dialogvoid
setFullscreen(fullscreen)Set fullscreen modevoid

MFixedContainer

Fixed position container for headers, footers, or floating elements.

Properties

PropertyTypeDescription
positionString"top" or "bottom"
heightIntegerContainer height

MTabBar

Bottom tab navigation - standard mobile navigation pattern.

Properties

PropertyTypeDescription
tabsTabTab definitions
activeTabIntegerActive tab index
showLabelsBooleanShow tab labels

Events

EventDescription
TabChangeActive tab changed

Methods

MethodDescriptionReturns
addTab(tab)Add tab to barvoid
selectTab(index)Select tab by indexvoid
getActiveTab()Get active tab indexNumber
setShowLabels(show)Show/hide tab labelsvoid

Example

{
  widgetType: "MTabBar",
  tabs: [
    { label: "Home", icon: "home", view: "HomeView" },
    { label: "Search", icon: "search", view: "SearchView" },
    { label: "Profile", icon: "user", view: "ProfileView" }
  ],
  showLabels: true
}

MList

Scrollable list container for displaying collections of items.

Properties

PropertyTypeDescription
itemsListItemList items
groupedBooleanGroup items by category
searchableBooleanEnable search filtering

Methods

MethodDescriptionReturns
addItem(item)Add list itemvoid
removeItem(index)Remove list itemvoid
clear()Clear all itemsvoid
enableSearch(enabled)Enable/disable searchvoid
scrollToItem(index)Scroll to specific itemvoid

MListItem

Individual list item with title, subtitle, thumbnail, and navigation.

Properties

PropertyTypeDescription
titleStringItem title
subtitleStringItem subtitle
thumbnailStringThumbnail image URL
arrowBooleanShow navigation arrow indicator

Events

EventDescription
ClickItem clicked
SwipeLeftSwiped left (for delete actions)
SwipeRightSwiped right (for actions)

Methods

MethodDescriptionReturns
setTitle(title)Set item titlevoid
setSubtitle(subtitle)Set item subtitlevoid
setThumbnail(url)Set thumbnail imagevoid
setArrow(show)Show/hide arrow indicatorvoid

Example

{
  widgetType: "MListItem",
  title: "John Doe",
  subtitle: "john.doe@example.com",
  thumbnail: "/images/users/john.jpg",
  arrow: true
}

Input Widgets

MButton

Touch-optimized button with haptic feedback support.

Properties

PropertyTypeDescription
labelStringButton text
iconStringButton icon
blockBooleanFull width button
raisedBooleanRaised appearance with shadow

Events

EventDescription
ClickButton clicked

Methods

MethodDescriptionReturns
setLabel(label)Set button labelvoid
getLabel()Get button labelString
setIcon(icon)Set button iconvoid
setBlock(block)Set full width stylevoid
setRaised(raised)Set raised appearancevoid
pulse()Trigger pulse animationvoid
enable()Enable buttonvoid
disable()Disable buttonvoid

Example

{
  widgetType: "MButton",
  label: "Submit",
  icon: "check",
  block: true,
  raised: true
}

MTextField

Mobile text input with keyboard type support and floating labels.

Properties

PropertyTypeDescription
inputTypeStringKeyboard type ("text", "email", "phone", "url")
clearButtonBooleanShow clear button
floatingLabelBooleanFloating label style

Events

EventDescription
ChangeValue changed
FocusField focused
BlurField blurred
KeyPressKey pressed

Methods

MethodDescriptionReturns
getValue()Get text input valueString
setValue(value)Set text input valuevoid
clear()Clear input valuevoid
setInputType(type)Set keyboard input typevoid
showClearButton(show)Show/hide clear buttonvoid
setFloatingLabel(floating)Enable floating label stylevoid

Example

{
  widgetType: "MTextField",
  inputType: "email",
  placeholder: "Enter your email",
  floatingLabel: true,
  clearButton: true
}

MTextArea

Mobile multi-line text input with auto-grow support.

Properties

PropertyTypeDescription
autoGrowBooleanAuto-expand height as user types
maxRowsIntegerMaximum rows when auto-growing

Events

EventDescription
ChangeContent changed
FocusField focused
BlurField blurred
KeyPressKey pressed

Methods

MethodDescriptionReturns
getValue()Get textarea contentString
setValue(value)Set textarea contentvoid
clear()Clear textarea contentvoid
appendText(text)Append text to current contentvoid
setAutoGrow(autoGrow)Enable auto height expansionvoid
setMaxRows(rows)Set maximum rows when auto-growingvoid
getLineCount()Get current number of linesNumber

MNumberField

Mobile numeric input with numeric keyboard.

Properties

PropertyTypeDescription
keyboardTypeString"numeric" or "decimal"
buttonsBooleanShow increment/decrement buttons

Events

EventDescription
ChangeValue changed
FocusField focused
BlurField blurred
KeyPressKey pressed

Methods

MethodDescriptionReturns
getValue()Get numeric valueNumber
setValue(value)Set numeric valuevoid
increment()Increment value by step amountvoid
decrement()Decrement value by step amountvoid
setKeyboardType(type)Set mobile keyboard typevoid
showButtons(show)Show/hide increment/decrement buttonsvoid

MDateField

Mobile date picker using native device picker.

Properties

PropertyTypeDescription
modeString"date", "time", or "datetime"
nativeInputBooleanUse native device picker

Events

EventDescription
ChangeDate changed
FocusField focused
BlurField blurred

Methods

MethodDescriptionReturns
getValue()Get selected date valueDate or String
setValue(value)Set date valuevoid
setMode(mode)Set picker modevoid
showPicker()Show native date pickervoid
setNativeInput(native)Use native picker interfacevoid
getFormattedValue()Get formatted date stringString

Example

{
  widgetType: "MDateField",
  mode: "datetime",
  nativeInput: true
}

MSwitch

Toggle switch control - iOS/Android style toggle.

Properties

PropertyTypeDescription
onLabelStringOn state label
offLabelStringOff state label
colorStringSwitch color when on

Events

EventDescription
ChangeSwitch state changed

Methods

MethodDescriptionReturns
getValue()Get switch stateBoolean
setValue(value)Set switch statevoid
toggle()Toggle switch statevoid
setOnLabel(label)Set label for on statevoid
setOffLabel(label)Set label for off statevoid
setColor(color)Set switch color themevoid

Example

{
  widgetType: "MSwitch",
  onLabel: "Enabled",
  offLabel: "Disabled",
  color: "#3498db"
}

MCheckBox

Mobile checkbox with touch-friendly sizing.

Properties

PropertyTypeDescription
labelStringCheckbox label
positionStringLabel position ("left" or "right")

Events

EventDescription
ChangeCheckbox state changed

Methods

MethodDescriptionReturns
getValue()Get checkbox stateBoolean
setValue(value)Set checkbox statevoid
toggle()Toggle checkbox statevoid
setLabel(label)Set checkbox labelvoid
setPosition(position)Set label positionvoid

MRange

Mobile range slider with optional dual handles.

Properties

PropertyTypeDescription
minNumberMinimum value
maxNumberMaximum value
dualBooleanDual handle mode for range selection

Events

EventDescription
ChangeValue changed (on release)
SlideValue changing (during drag)

Methods

MethodDescriptionReturns
getValue()Get slider value(s)Number or Array (dual mode)
setValue(value)Set slider value(s)void
setMin(min)Set minimum valuevoid
setMax(max)Set maximum valuevoid
setDual(dual)Enable dual handle modevoid
getHandlePosition(handle)Get handle position (0 or 1)Number

Example

// Single value slider
{
  widgetType: "MRange",
  min: 0,
  max: 100,
  value: 50
}

// Dual handle range slider
{
  widgetType: "MRange",
  min: 0,
  max: 1000,
  dual: true,
  value: [200, 800]
}

Display Widgets

MCard

Content card container for displaying grouped information.

Properties

PropertyTypeDescription
titleStringCard title
imageStringCard header image URL
actionsActionCard action buttons

Events

EventDescription
ClickCard clicked
ActionClickAction button clicked

Methods

MethodDescriptionReturns
setTitle(title)Set card titlevoid
setImage(url)Set card imagevoid
addAction(action)Add action buttonvoid
removeAction(index)Remove action buttonvoid
setContent(content)Set card contentvoid

Example

{
  widgetType: "MCard",
  title: "Product Name",
  image: "/images/product.jpg",
  actions: [
    { label: "Buy Now", handler: "handleBuy" },
    { label: "Details", handler: "showDetails" }
  ]
}

MHeading

Mobile heading text with semantic levels.

Properties

PropertyTypeDescription
levelIntegerHeading level (1-6)
textStringHeading text

Methods

MethodDescriptionReturns
getText()Get heading textString
setText(text)Set heading textvoid
setLevel(level)Set heading level (1-6)void
getLevel()Get current heading levelNumber

MText

Mobile text display with truncation support.

Properties

PropertyTypeDescription
textStringDisplay text
truncateBooleanTruncate long text with ellipsis

Methods

MethodDescriptionReturns
getText()Get display textString
setText(text)Set display textvoid
setTruncate(truncate)Enable text truncationvoid
getFullText()Get full untruncated textString

MIcon

Mobile icon display with badge support.

Properties

PropertyTypeDescription
iconStringIcon name from icon library
badgeStringBadge text (e.g., notification count)

Methods

MethodDescriptionReturns
getIcon()Get current icon nameString
setIcon(icon)Set icon namevoid
getBadge()Get badge textString
setBadge(text)Set badge textvoid
clearBadge()Clear badge textvoid

Example

{
  widgetType: "MIcon",
  icon: "bell",
  badge: "5"
}

MFab

Floating action button - primary action button that floats above content.

Properties

PropertyTypeDescription
iconStringButton icon
positionStringScreen position ("bottom-right", "bottom-left", "top-right", "top-left")
miniBooleanMini size variant

Events

EventDescription
ClickButton clicked

Methods

MethodDescriptionReturns
getIcon()Get button iconString
setIcon(icon)Set button iconvoid
setPosition(position)Set screen positionvoid
setMini(mini)Set mini size modevoid
pulse()Trigger pulse animationvoid
click()Programmatically trigger clickvoid

Example

{
  widgetType: "MFab",
  icon: "plus",
  position: "bottom-right",
  mini: false
}

Data Binding in Mobile Widgets

Direct Binding

Bind a widget directly to a model attribute:

Widget: MTextField
Property: value
Binding: customer.name

Calculated Binding

Display computed values:

Widget: MText
Property: text
Binding: order.quantity * order.unit_price

Event Binding

Respond to user interactions:

Widget: MButton
Event: onClick
Action: Save record and navigate to list

Mobile Navigation Patterns

Tab-Based Navigation

The most common mobile navigation pattern:

MView
├── Content Area (scrollable)
│   └── Your content widgets
└── MTabBar (fixed at bottom)
    ├── Tab: Home
    ├── Tab: Search
    ├── Tab: Favorites
    └── Tab: Profile

List-Detail Pattern

Standard master-detail navigation:

MView: CustomerList
├── MList
│   └── MListItem (for each customer)
│       onClick: Navigate to CustomerDetail

MView: CustomerDetail
├── Back button in header
├── Customer information
└── Action buttons

For confirmations and quick forms:

MButton: "Delete"
onClick:
  MDialog.show({
    title: "Confirm Delete",
    content: "Are you sure?",
    actions: ["Cancel", "Delete"]
  })

Mobile-Specific Best Practices

Touch Targets

  • Minimum touch target size: 44x44 pixels
  • Adequate spacing between interactive elements
  • Use MButton with block: true for primary actions

Performance

  • Use virtual scrolling for long lists
  • Lazy load images in MList
  • Minimize view complexity

Gestures

  • Support pull-to-refresh for data updates
  • Use swipe gestures on MListItem for quick actions
  • Provide visual feedback for all interactions

Responsive Layouts

  • Design for portrait orientation first
  • Test on various screen sizes
  • Use flexible containers that adapt to screen width

Next Steps