LogoLogo
  • 👋Welcome
  • 🎓Academy
    • Getting Started
    • Connecting Data Sources
      • Jet Database
      • Google Sheet
      • Airtable
      • Custom API Action (Zapier)
      • Firebase
    • Data Editor
      • Data Editor Interface
      • Data Source Settings
      • Prepare & Organize Data
      • Edit Data
      • Field Types
      • Related Data
      • Lookups & Rollups
      • Files & Storages
      • Data Blending Intro
    • App Builder
      • Builder and User Modes
      • Pages and Overlays
      • UI Builder
      • Bind Data to UI
      • Bind Filter to Table
      • Bind Input Field to Table
      • Bind Form to Table
      • Bind Related Tables
      • Bind across Pages
      • Bind from Page to Modal
      • Calculcation & Formulas
    • Team & Users Permissions
    • Automations
    • Environments
    • Custom API Collection
    • Nested Filters
    • Built-in Approval Flow
    • Create Multi-Step Forms
    • Component Designer
    • Build Apps Together
      • Custom CRM
      • Internal Tool
      • Customer portal
      • Supabase CRM
    • Import Figma design to Jet
    • Authentication
      • Supabase Auth
      • Firebase Auth
      • Xano Auth
  • 📣What's new
  • 🔐Data Privacy & Security
  • 🙌Join the Community
  • 🐞FAQ and Troubleshooting
    • A data resource is failing to sync
    • Data is not loading
    • How to clone the whole app?
    • Why new SQL tables are not showing?
    • How to restrict input in a text field?
    • Troubleshooting Django integration
    • How to Connect to Slack Channel
  • Guides
    • ⚡Quickstart
    • 🛠️Building an Internal Tool
      • Connect your Data
      • Configure Data
      • Build UI
      • Run Actions
      • App Customization
      • Publish your App
    • 👥Creating a Customer Portal
      • Prepare your Data
      • Generate the App
      • Set the Layout
      • Link Related Tables
      • Customize your Portal
      • Users & Permissions
    • 🤿 Deep dives
      • Single relations
      • Conditional Visibility
      • Reading data from API
      • Reading data from SQL
      • Generate Invoice or Document
        • Document
    • 📧Send Emails
    • 🎨Pixel Perfect App
      • Designing your component
      • Adding Images
      • Apply Frame to Image
      • Pass values to Image
      • Pass values to Text Field
      • Binding data
      • Hide elements
      • Support multi-screens
    • 🚀UI in seconds
    • 🪅Figma design into a web app
  • AI Custom Components
    • Enhance Your Prompts with AI Assistance
    • Enhancing Your Prompts with Images
    • Auto-Generate Parameters and Actions
    • Edit Your Custom Code with the Custom Component Builder
    • Import and Iterate on Your Existing Components
  • References
    • 🦄Core concept
      • Jet UI
        • App settings
          • Appearance Settings
          • Adding Custom Fonts
          • Theme & Styles
          • Menu
          • App Info
          • Custom Domain and Transactional Emails
          • Sign Up
          • Features
          • Custom Scripts & Styles
      • Intro to Data
      • Navigation
      • Menu Conditional Enabled
      • Set Variable Action in Menu
      • Sharing your app
        • Invite by Email
        • Invite by Link
        • Creating a Public Page
    • 🧰Data Sources
      • Database resources
        • Instant Installation
        • Docker Installation
        • Python app Installation
      • Jet Tables
        • Storage & Files
      • Rest API
        • Basic Authentication
        • Bearer Token
        • OAuth 2.0
        • Jet Requests Auth
      • Firebase / Firestore
        • Syncing Firebase Data Using Functions
        • Firestore
        • Import CSV into Firebase
        • Firebase Cloud Storage
        • Realtime DB
        • Visualize Subcollection
      • Google Sheets
        • Working with Data
      • Airtable
      • MongoDB
      • Amazon Athena (AWS Athena)
      • Databricks
      • CockroachDB
      • ClickHouse
      • GraphQL
      • Supabase
      • Django
      • MySQL
      • MariaDB
      • Xano
        • Create APIs on top of your Xano database
        • Connect Xano to Jet Admin
        • Upload files to Xano
      • SmartSuite
      • Stripe
      • Hubspot
      • Intercom
      • Zendesk
      • Salesforce
      • Slack
      • Zapier
      • Webflow
      • Amazon S3 and S3 compatible storage
      • Google Cloud Storage
      • SendGrid
      • Twilio
      • Mixpanel
      • Snowflake
      • OpenAI and Jet Admin
      • Supabase Storage
    • 🔗Binding & Values
      • Binding Components
      • Extract & Pass Values
      • Binding two related Tables
      • Binding Form to Table
      • Binding Filter to Table
      • Binding Field to Table
      • Binding across Pages
      • Binding across Overlays
    • 🔠Variables
    • 🌈Basic Columns
    • 🔢Computed Column
      • Relations
      • Rollup Column
      • Lookup Column
      • Formula
        • Setting up promotional email
        • Create Custom fields using Formulas
        • Parse JSON Fields
        • Math Column
        • List of Functions
      • JavaScript Column
      • Calculated values in column
    • 🎨Design & Structure
      • Customizing Pages
        • Create a New Page
        • Copy the Page
        • Customize the Page
        • Page Values
        • Link Pages
        • Load Data (Page Query)
        • Page Opens Action
        • Home Page
      • Components
        • Lists
          • Table
            • Grouping records
            • Filters (built-in)
            • Table Actions
          • Map
          • Kanban
          • Calendar
          • Gallery
          • Carousel
          • Timeline
        • Filters
        • Form
          • Create a Form
          • Customize a Form View
          • Examples
          • Page
          • Select
          • Multiple Select
        • Fields
          • File
          • Multiselect / Chips
          • Checkbox
          • Date & Time
          • Date Range
          • Image
          • Text
          • Password
          • Number
          • Rating
          • Slider
          • Range Slider
          • Steps
          • URL
        • Charts
          • How to Set Up a Chart
            • Chart Appearance
            • Drill Down
          • Line
          • Bar
          • Pie
          • Doughnut
          • Single value
        • Text
        • Buttons
        • Button Group
        • Custom Notifications
        • Component Actions
        • Detail
        • Layouts
          • Containers
          • Accordion
          • Collapse
          • Columns
          • Overlays
            • Customizing Overlay
            • Overlay Parameters
            • Building dynamic workflows
          • Slideout
          • Tabs
          • Vertical Tabs
        • HTML Component
        • JavaScript component
          • Create a JavaScript Component
          • Set JavaScript Component Inputs
          • Use JavaScript Component Outputs
        • File PDF Viewer
        • QR Code
        • Bar Code
        • Scanner
        • Signature
        • IFrame
        • Alert
        • Accordion
        • Chips
      • Field Values
        • Extract values from components on the Page
      • Nested Filters
      • Advanced Filters
      • Sort
      • Group
      • Actions
      • Dropdown Popups
      • Export
      • App Theming
      • Global CSS & JS
      • Analytics or Live chats
    • 🧮Data Editor
      • Syncing Schema and Data
      • Managing Columns
      • Making API requests
        • Endpoint Response Outputs
        • Response Transformer
        • Sorting data
        • Pagination
          • Page-based pagination
          • Offset pagination
          • Cursor based pagination
      • Making SQL queries
      • Text to SQL
      • Storages
      • File Storage and Uploading
        • Jet Admin Storage
        • Data Source Storage
      • Cache Frequency
      • Many-to-many relationship
    • 🧞‍♂️Visibility rules
    • ℹ️Conditionals
      • Conditional Visibility
        • Examples
          • Hiding a component until a row is selected
          • Hiding a component until a row with a certain value is selected
          • Hiding a component using the Page Value, User, or Team Property value
          • Hiding a component using multiple conditions
      • Conditional Disable
      • Conditional read, add, edit & delete
    • 🔐Users & Permissions
      • Sign In/Sign Up
        • Auth0 SSO OAuth 2.0
        • Auth0 SSO SAML2
        • Azure AD SSO OAuth 2.0
        • Okta SSO
        • Google SSO OAuth 2.0
        • Google SSO SAML2
        • Custom SSO OAuth 2.0
        • API calls with SSO token
      • Roles in Permissions
      • User-specific Permissions
    • ▶️Preview & Publish
      • Embed Apps
        • Embedding App using a generated link
        • Embedding App using iFrame/HTML
    • ⚙️ Automations & Workflow
      • Triggers
      • Steps
        • Actions
        • Rules
      • Inputs, Outputs, Parameters
      • Test & Debug
      • Approval Workflow
      • Success/Error Actions
      • Iterators
      • Zapier Workflows
    • 👨‍💻Javascript
    • 💠360 Data/Data Blending
      • Sync Connection
      • Blending the Data
      • Sync Options
    • 🔤Localization
      • Account Settings
      • Adding Language to Jet Admin
      • End-user Localization
    • 🎚️Version Control
      • Cross-Instance Backup Restoration
    • 📖Logs
    • 🪂Other Features
      • Environments
        • Merge Environments: Jet Tables and Custom Components
      • Audit logs
      • Manage your subscription
      • Custom domain
      • Update to a new version
    • 🛫Jet Admin API
      • Interacting with Jet Admin API
        • Get API Token
      • Users API
      • Teams API
      • Projects API
      • Pages API
      • HTTP requests API
    • 🔐Authentication systems
      • Jet Auth
      • Firebase Auth
      • Auth0
      • Supabase Auth
      • Token-based Auth
      • Xano Auth
    • 🎇Integrations
  • 🖍️Component Designer
    • How to use pixel-perfect components
    • How to work with component designer
    • Right sidebar
      • Layout
      • Auto Layout
      • Conditional Visibility
      • Component Responsiveness / Constraints
      • Fills
      • Borders
      • Shadows
      • Interactions
    • Frames and Groups
    • Action components
    • Component and layer states
  • 🖼️Import Figma Design
    • Install Plugin
  • DEPLOYMENT
    • ⛅Cloud
    • 🏎️Self-hosted
      • SSO on self-deployed Jet Bridge
      • Using self-deployed HTTP proxy
      • Common Problems
      • Configuration
    • 🖥️On-premise
      • Deploy On-Premise Jet Admin with Docker
      • Update
      • .env configuration (local host)
        • Custom Domain Configuration on-premise
        • Email Sending Configuration
        • Nginx Configuration
      • Service Health Check
      • Common Problems
      • Superuser access
    • ⛺️ Database Heroku deployment
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. References
  2. Design & Structure
  3. Components
  4. JavaScript component

Create a JavaScript Component

In this section you will learn how to create a Custom Component

PreviousJavaScript componentNextSet JavaScript Component Inputs

Last updated 1 year ago

Was this helpful?

In this tutorial, we'll show you how to create a sample Custom Сomponent that you can, later on, extend to satisfy whatever needs you have.

1. Create your JavaScript component project (playground) or clone an example

A JavaScript Component uses specification to integrate any JS-based component to Jet Admin – this allows you to use any Frameworks and Libraries you like as long as you create them as custom Web Components. So it can be React, Angular, or Vue. js-based components, or any other.

First, you need to create a JavaScript Component project where you can develop and test it. This project will be your playground for creating JavaScript Components. It will work the same way as on Jet Admin but will make your development easier so that you can use your favorite IDE and environment. To make it simpler, you can use some of our ready-to-use starter projects on GitHub or use them as a reference:

  • React –

  • Angular –

For example, here's an example of cloning React and preparing it for work:

git clone git@github.com:jet-admin/jet-flex-view-react-example.git
cd jet-flex-view-react-example
npm install

2. Run your project

After you created your project and cloned an example, make sure it works by running this command (or any other you use):

npm run start

The project works fine, so you can start developing your JavaScript Component. But before that, read the following step if you need the Jet Admin API integration.

Consider the following limitations while developing:

  • You can't change the URL inside the Custom Component since the component is embedded using inside Jet Admin view

  • Consider incapsulating styles inside your view, not using global styles

3. (optional) Set up Jet API integration

To integrate your custom JavaScript Component with Jet Admin data and API, you can use the Jet Admin SDK library. To start using it, you would have to install it first:

npm install jet-admin-sdk

To work with API and perform queries, the SDK needs to know which Project you are working with and your Access Token. When a Custom Component is uploaded to production, it will fetch these automatically, but for development, you need to specify it manually, as shown below:

import { getPublicApiService } from 'jet-admin-sdk';

if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
  getPublicApiService().projectsStore.setCurrent('YOUR_PROJECT_UNIQUE_NAME');
  getPublicApiService().authService.tokenLogin('YOUR_USER_TOKEN');
}
  • YOUR_PROJECT_UNIQUE_NAME – can be taken from the URL of your project on Jet Admin

That's it! You can now use Jet Admin API through PublicApiService. For example:

import { getPublicApiService } from 'jet-admin-sdk';

getPublicApiService().currentUserStore.get().subscribe(result => {
  if (result) {
    console.log('Current User is ' + result.username);
  } else {
    console.log('Failed to get Current User');
  }
});

4. Upload your JavaScript Component to Jet Admin

Once you're finished with your JavaScript Component or just want to test it in a real application, you need to upload it. Build your project first:

npm run build

Usually, it will create your build files in the dist folder, but it can differ for your environment. To upload your Custom Component to Jet Admin, you need to upload a .zip file with your build files. Go to the dist folder and compress all the contents to a single .zip file.

Now go to Jet Admin and create a Custom Component as shown below.

You will need to specify the following settings and click the Save button:

  • Compiled custom element – a zip file containing your build files of JavaScript Component.

  • Custom element tag name – tag name that you used for the Web Component inside your JavaScript Component project. Should be prefixed with "jet-" and has a dash-case. Also, each of your JavaScript Components should have unique tag names across your Jet Admin project.

  • Files to include in page – for your JavaScript Component to work JS and maybe CSS files should be included. You should check which files from your zip files should be included. The order of loading can be changed. These files will be included only once when Custom Component should be displayed and after inclusion they must define a custom element with a tag name the same as you specified for the Custom element tag name.

That's a wrap. Feel free to test your Jet Admin now. If you want to update it later, upload a new .zip file inside Custom Component.

YOUR_USER_TOKEN – can be taken from the cookie token on

🎨
https://app.jetadmin.io/
Web Component
https://github.com/jet-admin/jet-flex-view-react-example
https://github.com/jet-admin/jet-flex-view-angular-example
http://localhost:3000/