Giter VIP home page Giter VIP logo

perfect-gui's Introduction

Perfect GUI

A nice, simple and (probably not) perfect GUI for JavaScript.

API

Documentation

Features

  • image buttons
  • multiple panels
  • easy positioning
  • draggable panels
  • two-dimensional vector visualization

Install

With NPM

npm i perfect-gui

Import from a CDN

<script type="importmap">
  {
    "imports": {
      "perfect-gui": "https://unpkg.com/perfect-gui@latest/dist/perfect-gui.mjs",
    }
  }
</script>

Hello world

import GUI from 'perfect-gui';

const gui = new GUI();

gui.button('Click me', callback);

Options

const gui = new GUI({
    name: 'My GUI',
    // Name of the panel. 
    // Default is null.

    container: '#container',
    // Element containing the GUI
    // Default is document.body
    
    width: 250,
    // Width of the panel (in pixels). 
    // Default is 290.

    maxHeight: 500,
    // Maximum height beyond which scrolling is necessary. 
    // Default is the smallest value between the height of the window and the height of the container.
    
    closed: false, 
    // Defines whether the panel should be closed by default. 
    // Default is false.

    position: 'bottom right',
    // Defines where to place the panel on screen.
    // Accepted values are 'top', 'bottom', 'left' and 'right' in no particular order ('bottom right' = 'right bottom').
    // If multiple instances have the same position, they will be stacked horizontally.
    // Default is 'top right'.

    draggable: false,
    // Defines if the panel can be manually moved across the screen.
    // Default is false.

    autoRepositioning: true,
    // If set to true, the panel position will be reset when the screen is resized.
    // If a panel has been dragged, it won't be be affected.
    // Default is true.

    color: '#bada55',
    // Default is #2e2e2e

    onUpdate: () => {
      // Callback function triggered each time this GUI instance is updated.    
    }
});

perfect-gui's People

Contributors

thibka avatar dependabot[bot] avatar

Stargazers

 avatar Charles Cabral avatar  avatar M.Mirza Zanuar avatar Alex Ionkov avatar Jeffrey Castellano avatar Bell avatar Miguel Gargallo avatar shadow avatar Pavel avatar Derrick Schwabe avatar Julian Garnier avatar sean tai avatar Komunica avatar Zhenya Nemerovchenko avatar adow avatar Laurence Louis Trippen avatar Sara Tasche avatar

Watchers

James Cloos avatar  avatar

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.