A small component based app library composing user interfaces and apps.

Related tags

React VibeJS
Overview

VibeJS JavaScript Library See https://vibejs.com for ongoing documentation and info.

Stargazers repo roster for @bretgeek/vibejs

VibeJS

  • A small component based JavaScript library to build user interfaces and apps.

If you are looking for an alternative to bigger libraries like VueJS and React with a much easier learning curve, then VibeJS may just be what you need.

Features

  • Small - currently under 14KB minified.
  • Create self contained components for composing larger components and apps.
  • Optionally access components externally.
  • Rendered components receive built-in methods (the Vibe).
  • Easy Familiar syntax with built-in chainable DOM manipulation methods.
  • Built-in Drag and Drop, Swipe
  • Pass in external functions or plugin functions to your rendered components.
  • Ability set up custom observers on rendered components.
  • Convert any element or HTML string to a Vibe'd element.
  • And more ...

Basic Usage

  • Basic usage for manually adding and using VibeJS into a web page. (see Bundle with Webpack below for alternate method of use with a bundler)

Add Vibe to your page before closing body tag :

<script src='https://yoururl.com/vibe.min.js'></script>

Make a component with a function: (in a script tag or external.js/bundle.js)

const myComponent = () => {

    const template = `<div>Hey, I am app!</div>`;
    
    const func = function say() {
        console.log('I am app')
    };
    
    // init runs autmatically if it exists (and is in return object)

    const init = function init(e) {
    console.log('I am an '+e)
    e.$css('cursor: pointer;').$text{'I am new text');  // can chain built-in e.$fns DOM methods! 
    }; 
    
    const click = function click(e) {
        console.log('clicked ' + e.target.tagName );
    };  

    const state = {x:1};

   // Render uses this return object to add these to the component

    return {
        template: template,
        className: 'myComponent',
        init: init,
        fn: { 
            func: func
        },  
        events: {
            click: click,
        },  
        state: state
    }   
}   

Render the component to a DIV with an id of "app" and save a reference to it as "myRef"

  • In an html file:
// somewhere in your html

<div id='app'> </div>
  • In a script tag after vibe.min.js:
// className, state, events, plugins (like fn of component) etc. can be added here too

const myRef = $vibe.render(myComponent, {
    to: '#app',
    position: 'append',
    className: 'renderedComponent',
});
  • Note: You can render a component as many times as you want with different reference names.

Components are self contained however, after rendering you can also do things with the reference ( "myRef" in this case) like:

// Call built-in Vibe functions to change the css and the text etc. (chainable).

myRef.$css('display: inline-block').$text('Hey hey!');



// Call the internal function you declared in the component

myRef.$fn.func(); 



// Tack on more events with $on 

myRef.$on('click', function(){ console.log('my Text is: '+this.$text()) });
  • Components can render other components too (hint: modules/import/export within components).

Bundle with Webpack

In dist/index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>App</title>
  </head>
  <body>
      <div id='app'></div>
    <script src="https://cdn.jsdelivr.net/gh/bretgeek/VibeJS@main/vibe.min.js"></script>
    <script src="main.js"></script>
  </body>
</html>

In /src/App.js

export const App = () => {

    const template = '<div>I am app!</div>';
    const func = function say() {
        console.log('I am app!')
    };  
    
    const init = function(e) {
    console.log('I am e '+e)
         e.$css('cursor: pointer;');
    }; // can add extras on e too a init time

    const click = function click(e) {
        console.log('clicked ' + e.target.tagName );
        this.$text('I was clicked!')
    };  
    const state = {x:1};
    return {
        template: template,
        className: 'webpacked',
        init: init,
        fn: {
            func: func
        },  
        events: {
            click: click,
        },  
        state: state
    }   
}

In /src/index.js

import {App} from '/src/App.js';

function tip() {console.log('tip') };
const Appref = $vibe.render(App, {
    to: '#app',
    position: 'append',
    plugin: {tip: tip} ,
});
Appref.$plugin.tip();

bundle it to dist/main.js with.

npx webpack
  • Visit dist/index.html to test!

More documentation/usage/tutorials coming soon...

Until then, feel free to ask questions, read the code or visit https://vibejs.com for lots more info.

You might also like...

An accessible dropdown component for use in Ember apps.

ember-a11y-dropdown This is an accessible dropdown that you can use in your Ember app for a menu dropdown. I'm making it so people can stop using the

Feb 10, 2022

As a user, I want to be able to post about travel locations and provide comments and ratings. As a user, I want to be able to look at other users posts and search travel locations by rating.

As a user, I want to be able to post about travel locations and provide comments and ratings. As a user, I want to be able to look at other users posts and search travel locations by rating.

Travel-bug https://travelbug-project.herokuapp.com/ Table of Contents User-Story Description Installation Usage Contributions Tests License Questions

Mar 2, 2022

Edvora App is a web application based on an external API, showing data about different types of products and the user can filter these data by choosing a specific state, city or product name. Build with React.js

 Edvora App is a web application based on an external API, showing data about different types of products and the user can filter these data by choosing a specific state, city or product name. Build with React.js

Edvora App is a web application based on an external API, showing data about different types of products and the user can filter these data by choosing a specific state, city or product name. Build with React.js

Mar 11, 2022

Recipe providing mobile app, User selects ingredients in pantry and is then provided recipes for those ingredients. App contains a signup/login, meal planner and grocery list pages.

Recipog Student Information Name Connor de Bruyn Username Destiro Assignment SWEN325 A2 Description “Recipog” is a recipe providing app that allows th

Dec 26, 2021

A component library based on Material Design 3 & Web Components

material-web-entity Material Web Entity A component library based on Material Design & Web Components Go to link to see what components this library s

Jun 3, 2022

Expo Config Plugin that generates an App Clip for iOS apps built with Expo.

react-native-app-clip Expo Config Plugin that generates an App Clip for iOS apps built with Expo. Warning This plugin is a work in progress and hasn’t

Dec 24, 2022

Income Expense Tracker is a user based income-expense tracking system featuring budget planning and statistical analysis.

Income-Expense-Tracker Features Income Expense Tracker is a user based income-expense tracking system featuring budget planning and statistical analys

Oct 6, 2022

A Vue.js popover component based on PopperJS

vue3-popper A popover component for Vue 3 Documentation Check out the documentation Getting started Usage Install NPM npm install vue3-popper Yarn yar

Dec 30, 2022

Collection of Animated 60 FPS TabBar Component's based on React Navigation.

Collection of Animated 60 FPS TabBar Component's based on React Navigation.

React Navigation TabBar Collection Collection of Animated 60 FPS TabBar Components based on React Navigation. Features 60 FPS Animation Beautiful TabB

Dec 9, 2022
Owner
Bret
JavaScript can do it.
Bret
A declarative, efficient, and flexible JavaScript library for building user interfaces.

React · React is a JavaScript library for building user interfaces. Declarative: React makes it painless to create interactive UIs. Design simple view

Facebook 200.2k Jan 8, 2023
Light-weight react-like maximum-optimistic library for building user interfaces.

wili Wili is a 2kb Light-weight react-like maximum-optimistic library for building user interfaces. Usage Welcome componenet: class Welcome extends Wi

Amir Fo 3 Feb 16, 2022
The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power apps.

Power CAT code components The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power a

Microsoft 70 Jan 2, 2023
TV Show App is an application that allows to searh tv shows based on user input. Each tv show is displayed in a Bulma Card component and when clicked, heads you to the official tv show site

TV SHOW APP TV Show App is an application that allows to search tv shows based on user input. Each tv show is displayed in a Bulma* Card component and

HENDEL SAMY 1 Dec 19, 2021
Boilerplate to get started building React-based interfaces for Crestron using CH5

Getting Started with Crestron UI This project was bootstrapped with Create React App. Example component communicating with the Crestron-CH5 library: i

Mukund Salia 3 Apr 25, 2022
A labeler component that Lays out text and overlays textual decorations like labels, predictions, and relations based on given data and handles user interactions on tokens.

react-text-annotator react-text-annotator is a labeler component that: Lays out text and overlays textual decorations like labels, predictions, and re

Microsoft 25 Dec 11, 2022
This simple and small react component can check your repository stars and change theme on light/dark

Repository metrics for react This beauty and easy (4KB) react component can help you add metrics to your repositories also you can change component th

Koma Human 2 Jun 25, 2022
A bookstore app that allows a user add a book, displays added book with reviews and rating for each book and allows a user delete a book.

BOOKSTORE A bookstore app that allows a user add a book, displays added book with reviews and rating for each book and allows a user delete a book. Bu

Promise Okechukwu 7 Nov 1, 2022
Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Onsen UI - Cross-Platform Hybrid App and PWA Framework Onsen UI is an open source framework that makes it easy to create native-feeling Progressive We

null 8.7k Jan 8, 2023
Vtexio-react-apps - Apps react para plafaforma VTEX.

Projeto Modal + Apps Extras Projeto modal setando cookies. Desenvolvido em React + TypeScript para aplicação em e-commerce VTEXIO. ?? Este projeto se

Marcelo 1 Jan 3, 2022