Coder Social home page Coder Social logo

rlugojr / phosphor-panel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blink1073/phosphor-panel

0.0 2.0 0.0 151 KB

A convenient Phosphor panel widget and layout.

License: BSD 3-Clause "New" or "Revised" License

Shell 3.09% TypeScript 91.68% JavaScript 5.23%

phosphor-panel's Introduction

phosphor-panel

Build Status Coverage Status

A convenient Phosphor panel widget and layout.

API Docs

Package Install

Prerequisites

npm install --save phosphor-panel

Source Build

Prerequisites

git clone https://github.com/phosphorjs/phosphor-panel.git
cd phosphor-panel
npm install

Rebuild

npm run clean
npm run build

Run Tests

Follow the source build instructions first.

npm test

Build Docs

Follow the source build instructions first.

npm run docs

Navigate to docs/index.html.

Supported Runtimes

The runtime versions which are currently known to work are listed below. Earlier versions may also work, but come with no guarantees.

  • IE 11+
  • Firefox 32+
  • Chrome 38+

Bundle for the Browser

Follow the package install instructions first.

Any bundler that understands how to require() files with .js and .css extensions can be used with this package.

Usage Examples

Note: This module is fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.

A Panel is a convenient Widget subclass which acts as a container for child widgets. Adding child widgets to a panel is simple:

import {
  Panel
} from 'phosphor-panel';

import {
  Widget
} from 'phosphor-widget';

let panel = new Panel();
let child1 = new Widget();
let child2 = new Widget();
panel.addChild(child1);
panel.addChild(child2);

A more realistic scenario would involve custom widgets and CSS layout:

class LogWidget extends Widget {
  ...
}

class ControlsWidget extends Widget {
  ...
}

let logPanel = new Panel();
logPanel.addClass('my-css-layout');

let log = new LogWidget();
log.addClass('log-widget');

let controls = new ControlsWidget();
controls.addClass('controls-widget');

logPanel.addChild(log);
logPanel.addChild(controls);

The Panel and PanelLayout classes make it simple to create container widgets which cover a vast swath of use cases. Simply add CSS classes to the panel and child widgets and use regular CSS to control their layout.

Alternatively, these classes may be subclassed to create more specialized panels and layouts. The PhosphorJS project provides several useful panels and layouts out of the box. Some of the more commonly used are:

phosphor-panel's People

Contributors

blink1073 avatar sccolbert avatar

Watchers

 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.