jac-mobui

Build cross-platform mobile and web apps in Jac using React Native MobUI primitives.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/PMN123/trapdoor --skill jac-mobui-pmn123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jac-mobui
Source: https://github.com/PMN123/trapdoor/tree/main/.agents/skills/jac-mobui
Command: npx skills add https://github.com/PMN123/trapdoor --skill jac-mobui-pmn123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react, react-dom, react-native-web, lucide-react, lucide-react-native, react-native-svg.

What problem does it solve? Writing a Jac app that runs natively on iOS and Android as well as the web requires avoiding HTML entirely and using React Native primitives, props, and styling rules that differ sharply from web development. This Skill encodes those rules so generated code compiles under the client_kind = "mobui" guard instead of failing with E1105 or breaking silently on native targets. ## Core Features & Use Cases - No-HTML rule enforcement: Maps every forbidden HTML tag (<div>, <span>, <button>, <input>) to its @jac/mobui primitive (View, Text, Pressable, TextInput) to avoid the E1105 codegen error. - React Native props and styling: Covers onPress/onChangeText events, StyleSheet.create token theming, flexbox layout gotchas, and cross-platform icon pairs via .jac / .native.jac files. - Project setup and builds: Provides the jac.toml configuration, npm dependencies, and commands for web preview, Expo/Metro native runs, and Android/iOS builds. - Use Case: Ask for a mobile todo app in Jac and receive a complete main.jac using MobUI primitives, a token-based theme.jac, and the correct jac.toml ready for jac start main.jac --dev. ## Quick Start Build me a cross-platform mobile app in Jac using MobUI primitives with a themed screen, a text input, and a button, then show me how to run it on web and native.

Frequently Asked Questions about jac-mobui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a React Native mobile app in Jac?

Set client_kind to "mobui" in jac.toml, add the react-native-web and icon npm dependencies, and author the UI in main.jac using @jac/mobui primitives like View, Text, Pressable, and TextInput. Run jac start main.jac --dev for web preview or jac start main.jac --client react-native --dev for native via Metro.

What is the difference between jac-mobui and jac-mobile-app?

MobUI compiles to real React Native components and forbids all HTML, while jac-mobile-app uses Capacitor to wrap the web bundle in a webview and keeps HTML. Choose MobUI for native widgets and Capacitor when you want to reuse an existing web UI.

Why does my Jac mobile app fail with error E1105?

E1105 is raised when a lowercase HTML tag that does not resolve to an in-scope component appears in a mobui project, and it blocks codegen. Replace HTML tags with MobUI primitives: View for div, Text for span or p, Pressable for button, and TextInput for input.

Can I use CSS or Tailwind classes in a MobUI app?

No, MobUI supports only React Native StyleSheet objects with camelCase properties passed via the style prop. Use StyleSheet.create with a token-based theme file, and merge overrides with array syntax like style={[styles.pill, {backgroundColor: col}]}.

How do I handle icons on both web and native in Jac?

Create an icon.jac file importing from lucide-react and an icon.native.jac file importing from lucide-react-native, both exposing an identical Icon component API. The compiler picks the .native.jac variant for the react-native target and the .jac file for web.

Why does HTML compile fine in my component file but break on native?

The E1105 guard is enforced only on the main.jac entry module and .native.jac files, not on plain .jac component files, so a div in Card.jac compiles clean yet fails on native. Author UI in main.jac or use @jac/mobui primitives everywhere instead of relying on the compiler.