Momen Docs
Go to Momen
  • Get Started
    • Introduction
    • Quick Start
    • Software Development Process
    • Editor Overview
  • Changelog
    • Latest Product Update
  • Build UI
    • Pages
    • Components
    • Canvas
    • Layout
    • Component - Display
    • Component - Input
    • Component - View
    • Component - List
    • Component - Tab View
    • Component - Select View
    • Component - Conditional View
    • Component - Others
    • Component - Map
    • Custom Component
  • Data
    • Overview
    • Data Model and Database
    • API
    • Variable
    • Parameter
    • Formula and Conditions
  • Actions
    • Overview
    • Request
    • Navigation
    • Actionflow
      • Custom Code
      • Database Trigger
    • AI
      • AI Data Model
      • AI Point
      • Vector Data Storage and Sorting
    • User Actions
    • Component Management
    • App and Page Management
    • Toast Notifications & Modal
    • Payment
    • SSO
    • Share
    • Location
    • File Management
    • QR Code
    • Clipboard
    • Conditional
    • Loop
  • Release and Growth
    • Publish Application
    • Upgrade Project
    • Multiple Clients
    • Permission
    • Log Service
    • SEO
    • Hosting Files
  • My Account and Community
    • My Wallet
    • Promoting Momen
    • Code Component
    • Collaboration
  • Debugging
    • How to Debug in Momen
    • Request Error Reference
  • Tutorial
    • How to Build an AI Needs Analysis Project?
    • How to Set Up Payment with Stripe Plugin?
    • How to Embed an Iframe Component into Your Momen Project?
    • How to Build Your Login Page?
    • How to Convert Momen App to Native Mobile App?
    • How to Build a CMS (MVP Version) in Hours?
    • How to Set a Countdown Timer When Sending a Verification Code
  • Template
    • AI Mental Health Assistant
    • Angry Dietitian
    • AI Help Center
    • AI Knowledge Base
    • SaaS Corporate Site
    • Blog
    • AI Feedback Tool
    • Feedback Tool, a Nod to Canny
    • Portfolio
    • Online Courses, a Nod to Udemy
    • Mobile Auto Repair AI Scheduler
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Getting Started
  • Platform Login
  • Project Creation
  • Editing Code
  • Publishing the Project
  • Importing Code Components
  • Database Synchronization
  • Configuring Component Properties
  • About Momen
  1. My Account and Community

Code Component

PreviousPromoting MomenNextCollaboration

Last updated 1 day ago

Introduction

Enhance your applications by adding custom-built React components. These components can enable dynamic forms with live validation, data-driven charts, advanced animations, transitions, interactive maps, and data visualizations, expanding the range of interactive functionality. Check out the showcase of data visualization .

Prerequisites

Before you begin, ensure you meet the following prerequisites:

  • Working knowledge of Momen

  • Basic front-end development experience

  • Familiarity with TypeScript

  • Ability to develop customized React components

For users new to React, consider exploring resources such as .

Getting Started

To begin, install Momen globally for local development. This setup provides the command alias zvm for simplified access to platform commands.

# Install globally
npm i -g momen-cli

To confirm that Momen is installed correctly, run zvm --version.

Platform Login

Use the following command to sign in from your project’s working directory. Replace username and password with your actual credentials.

# Sign in with your username and password
momen signin username password

Project Creation

Run the command below to create a new project.

# Create a new project
momen create project_name

This command generates a template project and registers it as a new code component project within Momen. While multiple components can be added, note that the initial setup doesn’t publish a version yet, so further steps are required to release it.

Editing Code

To start developing custom components, navigate to your project directory and install dependencies:

# Navigate to the project directory and install dependencies
cd project_name
npm install

A typical code component library project has the following structure:

  • In this step, you’ll define and set up custom components in your project. Each custom component requires a dedicated folder under src/components with the following files:

    • index.ts: for exporting the component

    • [ComponentName].tsx: for component logic

    Each component file must export four interfaces for property types:

    • [ComponentName]PropData: Defines data types received from the host project (supported types: string, number, boolean)

    • [ComponentName]StateData: Declares component states exposed to the host, with type State from the zvm-code-context package

    • [ComponentName]Event: Declares internal events with properties typed as EventHandler from zvm-code-context

    • [ComponentName]Prop: Combines the above three interfaces as propData, propState, and event

    Expose newly created components in src/components/index.ts.

Refer to the template’s example code for guidance. Follow the conventions strictly for proper component and declaration recognition.

Publishing the Project

To publish your project, update the version field in package.json to align with npm versioning guidelines. For example, follow the semantic versioning format like 1.0.0.

Then, run the following command within the project directory:

# Publish the project
momen publish

After publishing, the new code component library will be available for configuration in any project on Momen.

Importing Code Components

To add your custom code component to a no-code project:

  1. Click the icon on the left sidebar.

  2. Select your newly published component project in the pop-up window.

Once added, the component will appear at the bottom of the left sidebar.

Database Synchronization

After configuring or modifying a component, sync the database or preview to ensure it functions at runtime. To do this, click the database sync icon (located in the upper left of the interface).

Configuring Component Properties

Properties are parsed according to their declared types, so it’s essential to follow naming conventions and structure precisely to ensure compatibility with Momen.

About Momen

is a no-code web app builder that allows users to build fully customizable web apps, marketplaces, social networks, AI apps, enterprise SaaS, and much more. You can iterate and refine your projects in real-time, ensuring a seamless creation process. Meanwhile, Momen offers powerful API integration capabilities, allowing you to connect your projects to any service you need. With Momen, you can bring your ideas to life and build remarkable digital solutions, getting your web app products to market faster than ever before.

here
React official docs
Momen