UI Bakery Docs
RoadmapRelease notesSign In
  • 👋Welcome to UI Bakery!
  • 🌟Overview
    • 💡Video intro
    • ✨Main features
    • 🔖Glossary
  • 🛠️Getting started
    • Create an application
    • Build UI
      • Data mocking methods
    • Link components
    • Connect a data source
    • Load data
    • Bind data to UI
    • Transform data with JavaScript
      • Data mapping & transforming
    • Change component data
    • Send a form
    • Create a filter
    • Note on debugging
    • Deploy your application & invite users
  • 📌Concepts
    • Components
      • Component basics
      • Component methods
      • Components best practices
        • Input validation
        • Linking a Table to a Form/Detail
        • Using a single Form to add and update data
        • Searching Table based on input value
        • Configuring server-side pagination
        • Managing Date object time zones
        • Role-based Menu component items
        • Field types & types recognition
          • Select/Tag field: Utilizing Tag mapper
        • Expanding component to fit screen/container
        • Controlling component's visibility
    • Custom components
      • Unrestricted custom components
    • Data sources
      • Data source environments
      • Connecting local database via ngrok
      • SSH Tunneling
    • Actions
      • Actions basics
        • Calling actions from code
      • Actions management & shortcuts
      • Actions settings
      • Actions library
      • Server actions
      • Logs and debugging
    • UI Bakery variables
    • State variables
    • Local storage
    • Modules
    • Custom JavaScript
      • JavaScript files
    • Workspace management
      • Account & workspace
      • Seats & Shared permission groups in UI Bakery
      • Roles in UI Bakery
      • Role permissions
      • Explore the interface
      • App environments
        • Release management
      • Audit logs
      • Multi-factor authentication
    • Export & import an app
    • Mobile layout
    • Theme editor
      • Changing theme from the app
    • UI Bakery source control
      • Git controls overview
      • Migrating your app model to the latest version
  • ⚡How-tos
    • File management
      • Working with PDF files
      • CSV import & export
      • Uploading files using methods
      • Displaying files from Google Drive and Dropbox
      • Parsing and sending XML
    • Styling
      • Modifying components with CSS
    • Layout & navigation
      • Adding navigation to application
      • Reading query params from URL
      • Hiding UI Bakery loader in the Embedded mode
    • Data
      • Managing user data with the {{user.email}} variable
      • Using JS libraries
        • Internationalization (i18n) & Localization: Translating UI Bakery Apps
      • Implementing row-level security
      • Copying to clipboard
    • Custom code
      • Communicating with external sites via Iframe
      • Implementing custom app hotkeys
      • Retrying API with HTTP status code 202
  • 🔎Extras
    • UI Bakery Automations
      • Environment and release strategy
      • Git in automations
      • Using external Node libraries
    • UI Bakery Database
      • Database migration
  • 💻On-premise
    • UI Bakery on-premise
    • Install & update
      • Installing on-premise
        • Azure virtual machine
        • Azure container instance
        • AWS EC2 instance
        • Google Cloud Compute Engine VM instance
        • DigitalOcean 1-click droplet
        • Manual w/ docker compose
        • Manual w/ docker run
        • Windows installation
        • Kubernetes
          • AWS EKS with Fargate
          • Scaling and resource optimization
      • Troubleshooting installation errors
      • Updating on-premise
      • Updating license key
      • Updating environment variables
      • Recommendations
        • Architecture overview
        • UI Bakery in production
        • Resource optimization
        • Running a standalone database instance
        • Generating custom secrets
    • On-premise features
      • External analytics
      • Branding
      • Embedding
      • SCIM 2.0
      • Instance API
      • Activating features under a feature flag
    • Additional configurations
      • Health check API
      • Email configuration
      • Google Sheets connection setup
      • Salesforce connection setup
      • Azure blob storage configuration
      • Adding python backend code to existing installation
      • UI Bakery Postgres
    • Networking & security
      • Setting up a domain name
      • Configuring custom certificate authority
      • Custom base URL
      • Getting requests to the local network
      • Setting up SSL on Ubuntu
    • SSO
      • OpenID
        • Google OAuth2
        • Okta ODIC
        • Azure AD OAuth2
        • Token refresh
      • SAML
        • Okta SAML
        • Azure AD SAML
      • Role synchronization
      • Multiple SSO
      • Logout redirect
      • Troubleshooting
    • Git source control
      • Manage multi-instance deployment
      • Custom PR URL
      • Automate GitHub releases
      • Automate GitLab releases
      • Automate Bitbucket releases
    • Environment variables
  • 📚Reference
    • Data security measures
    • Improving app security
    • ✨AI Assistant
    • List of Components
      • Azure Blob Storage file uploader
      • Accordion
      • Alert
      • Avatar
      • Boolean
      • Breadcrumbs
      • Bubble map
      • Button
      • Card
      • Chart
      • Chat
      • Checkbox
      • Collapsible card
      • Color picker
      • Composite form
      • Container
      • Context menu button
      • Currency
      • Currency input
      • Date picker
      • Date & time
      • Date & time picker
      • Detail
      • Divider
      • Email input
      • Embedded App
      • File
      • File dropzone
      • File picker
      • Flex container
      • Form
      • Frame drawer
      • Grid view
      • Heading
      • Horizontal menu
      • Icon
      • iFrame
      • Image
      • Image picker
      • JSON editor
      • JSON viewer
      • Link
      • List view
      • Map
      • Menu
      • Metric
      • Modal
      • Multi-select
      • Number
      • Number input
      • Password input
      • PDF viewer
      • Percent
      • Pop-up form
      • Progress bar
      • QR code
      • Radio
      • Range slider
      • Rating
      • Reusable header
      • Reusable sidebar
      • Select
      • Signature
      • Slider
      • Steps
      • Stepper
      • S3 file uploader
      • Table
        • Conditional formatting based on cell value
        • Display name instead of ID for relation
        • Row context referencing
        • Select multiple table rows
        • How to Highlight Text in a Table Using mark.js
      • Tabs
      • Tabset
      • Tags
      • Text
      • Text annotate
      • Text input
      • Time picker
      • Toggle
      • Tree component
      • Video
      • Dynamic structure properties
      • Card (deprecated)
      • Input (deprecated)
    • Upgrading components
    • List of Data sources
      • Airtable
      • AWS API
      • AWS Athena
      • AWS DynamoDB
      • AWS Lambda
      • AWS Redshift
      • AWS S3
        • S3 compatible endpoints (DigitalOcean spaces)
      • Azure Blob Storage
      • Big Query
      • Databricks
      • Exasol
      • Firestore, Firebase Auth & Realtime DB
        • Firebase authentication
        • Managing database data
        • Firebase client-side SDK
        • Firebase libraries
      • GitHub
      • Google Sheets
      • GraphQL
      • HTTP API
        • API Authentication
      • HubSpot
      • JDBC
      • MariaDB
      • MongoDB
      • MySQL
      • OpenAI
      • OpenAPI
      • Oracle
      • PostgreSQL
      • Presto
      • Redis
      • Salesforce
      • SAP Hana
      • SendGrid
      • Slack
      • SMTP
      • Snowflake
      • Spanner
      • SSH
      • Stripe
      • SQL Server
      • Supabase
      • Twilio
      • UI Bakery AI
    • List of Action steps
      • AI Action
      • Azure Blob Storage Query
      • Bulk Create Rows
      • Bulk Delete Rows
      • Condition
      • Create Row
      • Delete Row
      • DynamoDB Request
      • Execute Action
      • Firebase Query
      • Generate File
      • GraphQL Query
      • HTTP Request
      • Interval
      • JavaScript Code
      • Load Table
      • Load Row
      • Loop Action
      • MongoDB Command
      • Navigate
      • Open API Request
      • Python Backend Code
      • Redis Command
      • Save to Local Storage
      • Save to State
      • Show Notification
      • Slack messages
      • SMTP Request
      • SSH Command
      • SQL Query
        • Writing SQL Queries
      • S3 Query
      • Update Row
    • Troubleshooting techniques
    • Performance optimization
Powered by GitBook

© 2025 UI Bakery

On this page
  • Libraries included in UI Bakery
  • Using moment.js
  • Using lodash
  • Using i18next
  • External third-party JS libraries
  • Use case: Add a confetti blast upon Form submission

Was this helpful?

Export as PDF
  1. How-tos
  2. Data

Using JS libraries

PreviousManaging user data with the {{user.email}} variableNextInternationalization (i18n) & Localization: Translating UI Bakery Apps

Last updated 13 days ago

Was this helpful?

In UI Bakery, you can use either your own or any public JS library. Also, we have a number of libraries included out of the box - , , and . You can use these libraries straight away without any additional configurations.

In this article, we'll explore how you can use the included libraries and connect other external libraries.

Libraries included in UI Bakery

The moment.js and lodash libraries are preloaded in the JavaScript Code step. You can use them to manipulate dates and other values. For example, to transform date to a specific format:

return {{data}}.map(item => {
  return {
    ...item, // put all the keys from the original object
    created_at: moment(item.created_at).format('MMMM Do YYYY, h:mm:ss a')
  };
});

Or to get deep value from an object:

return _.get({ data }, 'birth.place.country', 'n/a');

We'll dive into more details about these libraries as well as i18next in the following sections.

Using moment.js

To use in your app, you don't need to configure it additionally as it comes pre-built. Simply follow the steps below:

  1. In your app, create a new action of the JavaScript Code type and specify the following code:

return {{ moment().format("dddd, MMMM Do YYYY, h:mm:ss a") }};
  1. Run the action and check the Result tab - you will see the actual date displayed.

Utilizing moment.js plugins

  1. Navigate to the Custom code tab and specify there the script tags of moment.js and the timezone plugin:

<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/moment-timezone@0.5.40/moment-timezone.min.js"></script>
  1. Now, create a JavaScript Code action and specify the following code requiring both of the libraries:

var moment = require('moment'); require('moment-timezone');

const now = moment();
return now.tz('America/Los_Angeles').format('ha z')
  1. Run the action and check the Result tab.

Using lodash

const data = {{ ui.table.selectedRow.data }};
return _.filter(
  {{ actions.list2.data }},
  _.matches({ 'userId': data.id, 'taskType': data.taskType }),
);

Using i18next

External third-party JS libraries

As we mentioned before, you can also connect any external JS library you need and use it in your app. In this section, we'll review an example how you can do that.

Use case: Add a confetti blast upon Form submission

Follow the instruction below to learn how to do that:

  1. Click on the library to open it and copy the provided JavaScript tag:

<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
IMPORTANT: Expand and read the information below before proceeding to the next step.

It is essential to ensure that you are loading the appropriate build for browser usage. The recommended approach is to load the minified UMD build from a CDN as opposed to the index.js file. This is because the index.js file may contain imports and require calls that require preprocessing before they can be utilized in the browser.

The naming conventions for builds that are suitable for loading in the browser vary among libraries, but are typically named following the "umd/<library>.min.js", "browser/<library>.min.js" or simply "<library>.min.js" format in the root folder.

For example, when using React:

  1. Now, navigate to the Custom code tab in your app and paste the copied tag there.

  2. Add a Form component to the working area.

  3. Next, create a new action consisting of two steps:

    1. For the first step, add a Create Row action.

    2. For the second step, add a JavaScript Code action and specify the following code:

confetti({
  particleCount: 500,
  spread: 300,
  origin: { y: 0.6 }
});
  1. Finally, navigate to the Triggers section of the Form and assign your newly created action to the On Submit trigger.

If you need to utilize some additional plugins, you need to set up both the library and the plugins you need. Below is an example of how you can add a moment-timezone plugin that helps with timezone manipulations. Check it out

To use in your app, just like with moment.js, you don't need to configure it additionally as it comes pre-built. Below is an example of using lodash when you need to filter a table by several keys of the selected row of another table. You just need to create a JavaScript Code action step and specify the following sample code:

also comes pre-built so no additional configurations are required. You can use this library to add translations to your application.

Check out this example of utilizing i18next in your app

Here we'll use the as an example - upon successful Form submission, users will get a confetti blast.

Start by locating the library you need on a public JavaScript CDN, for example, .

We'll be using library as an example.

🟢 You would want to use the file located at

🔴 Instead of , which contains require calls.

It is important to note that some libraries may not have a browser-compatible build available. An example of such library - .

Linking to the incorrect file may result in errors such as "require is not a function" or "module is undefined" in the browser console when starting your application. A comprehensive list of libraries and their respective browser-compatible builds can be found on the website.

Additionally, some libraries may be available as ESM builds and not available as UMD builds. If a library is not working as expected, you can check for the availability of ESM builds on , such as the example of library:

🟢 ESM will work - import yup from ''

🔴 UMD generated by jsdelivr will not work -

There are several listed on the site so you can choose whichever suits you best.

Submit your changes and enjoy the confetti!

⚡
👇
👇
🎉
moment.js
lodash
i18next
moment.js
lodash
i18next
Internationalization (i18n) & Localization: Translating UI Bakery Apps
canvas-confetti library
https://www.jsdelivr.com/
https://www.jsdelivr.com/package/npm/canvas-confetti
https://cdn.jsdelivr.net/npm/react@17.0.1/umd/react.production.min.js
https://cdn.jsdelivr.net/npm/react@17.0.1/index.js
https://www.jsdelivr.com/package/npm/@datasert/cronjs-matcher
https://www.jsdelivr.com/
https://www.jsdelivr.com/
https://www.npmjs.com/package/yup
https://cdn.jsdelivr.net/npm/yup@0.32.11/+esm
https://cdn.jsdelivr.net/npm/yup@0.32.11/lib/util/printValue.min.js
confetti code options