Search documentation of mob

# Mob (mob v0.6.18)

Copy Markdown View Source

Mob — BEAM-on-device mobile framework for Elixir.

OTP runs on the device. Screens are GenServers. The UI is rendered by Compose (Android) and SwiftUI (iOS) via a thin NIF. No server required.

## Quick start

    defmodule MyApp.HomeScreen do
      use Mob.Screen

      def mount(_params, _session, socket) do
        {:ok, Mob.Socket.assign(socket, :title, "Hello, Mob!")}
      end

      def render(assigns) do
        %{
          type:  :column,
          props: %{padding: :space_md},
          children: [
            %{type: :text, props: %{text: assigns.title, text_size: :xl}, children: []}
          ]
        }
      end
    end

## Modules

- `Mob.App` — app entry point and navigation declaration
- `Mob.Screen` — screen behaviour and GenServer wrapper
- `Mob.Socket` — assigns and navigation API
- `Mob.Theme` — design token system
- `Mob.Renderer` — component tree serialisation
- `Mob.Test` — live device inspection and testing helpers

See the Getting Started guide to create your first app. See Architecture & Prior Art for how Mob compares to LiveView Native, Elixir Desktop, React Native, Flutter, and native development.

## Summary

### Functions

assign(socket, kw)

See `Mob.Socket.assign/2`.

assign(socket, key, value)

See `Mob.Socket.assign/3`.

## Functions

# assign(socket, kw)

See `Mob.Socket.assign/2`.

# assign(socket, key, value)

See `Mob.Socket.assign/3`.