GithubHelp home page GithubHelp logo

core's Introduction

Form.io Core JavaScript Rendering Engine

This library is the core rendering engine behind the Form.io platform. It is a tiny (12k gzipped) rendering frameworks that allows for the rendering of complex components as well as managing the data models controlled by each component.

Usage

To use this library, you will first need to install it into your own application.

npm install --save @formio/base

Next, you can create a new component as follows.

import { Components } from '@formio/base';
Components.addComponent({
    type: 'h3',
    template: (ctx) => `<h3>${ctx.component.header}</h3>`
});

And now this component will render using the following.

const header = Components.createComponent({
    type: 'h3',
    header: 'This is a test',
});
console.log(header.render());  // Outputs <h3>This is a test</h3>

You can also use this library by including it in your webpage scripts by including the following.

<script src="https://cdn.jsdelivr.net/npm/@formio/[email protected]/dist/formio.core.min.js"></script>

After you do this, you can then do the following to create a Data Table in your website.

FormioCore.render(document.getElementById('data-table'), {
    type: 'datatable',
    key: 'customers',
    components: [
        {
            type: 'datavalue',
            key: 'firstName',
            label: 'First Name'
        },
        {
            type: 'datavalue',
            key: 'lastName',
            label: 'First Name'
        }
    ]
}, {}, {
    customers: [
        {firstName: 'Joe', lastName: 'Smith'},
        {firstName: 'Sally', lastName: 'Thompson'},
        {firstName: 'Mary', lastName: 'Bono'}
    ]
});

See https://formio.github.io/core for more examples of how to use this library.

core's People

Contributors

travist avatar AlexeyDavyd avatar RomanLetsuk avatar alexandraRamanenka avatar mikekotikov avatar

Stargazers

abhilash-aot avatar Paul Falgout avatar Phil avatar Stephen Russett avatar

Watchers

Travis Tidwell avatar James Cloos avatar Chase Sydow avatar James avatar Edwin Anciani avatar  avatar  avatar Jeriah Henley avatar Denise Kay avatar kadir avatar Maksim avatar  avatar

core's Issues

[BUG] Unknown plugin option jsonLogic

Environment

Please provide as many details as you can:
Direct use the formio/core render library in dist folder, found report error:
Unknown plugin option jsonLogic.

Then trying to build from source, get same error after invoke "npm install"

BTW, there no detail information about how to use the core library. like like to load plugin by usePlugin.

  • Hosting type
    • Form.io
    • Local deployment
      • Version:
  • Formio.js version: N/A
  • Frontend framework: N/A
  • Browser: Chrome
  • Browser version: 92.0.4515.107

Steps to Reproduce

  1. npm install

Expected behavior

No error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.