Skip to content

Commit b9aff6e

Browse files
committed
Improve readme.
1 parent 72e3c6b commit b9aff6e

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
phosphor-float-area
22
===================
33

4+
Draggable, dockable, resizable, floating, tabbed `Dialog` and `FloatArea` widgets:
5+
46
![Screen recording](https://raw.githubusercontent.com/charto/phosphor-float-area/gh-pages/demo.gif)
57

6-
A `FloatArea` widget based on [PhosphorJS](https://github.com/phosphorjs/phosphor).
7-
Widgets dropped over it become resizable, floating MDI-style dialogs.
8-
Widgets are also draggable between dialogs and dockable back to a containing `DockPanel` if available.
8+
100% Virtual DOM, TypeScript, [PhosphorJS](https://github.com/phosphorjs/phosphor)
9+
based modern JavaScript goodness :cake:
910

10-
Demo
11-
----
11+
Live demo
12+
---------
1213

13-
[See it online!](https://charto.github.io/phosphor-float-area/)
14+
[**Try it now!**](https://charto.github.io/phosphor-float-area/)
1415

1516
Alternatively, run the following commands and then open [localhost:8080](http://localhost:8080/) to see it in action:
1617

@@ -22,11 +23,32 @@ npm run prepublish
2223
npm start
2324
```
2425

25-
The demo uses [SystemJS](https://github.com/systemjs/systemjs), not webpack.
26-
That allows this repository to work directly from the public directory of any HTTP server.
27-
With `compileOnSave` (enabled in [`atom-typescript`](https://atom.io/packages/atom-typescript) or
26+
The demo uses [SystemJS](https://github.com/systemjs/systemjs).
27+
Works directly from the public directory of any HTTP server.
28+
With `compileOnSave` (eg. [`atom-typescript`](https://atom.io/packages/atom-typescript) or
2829
[TypeScript for VS Code](https://github.com/mrcrowl/vscode/releases/tag/13.10.8))
29-
the demo in a browser always stays up to date with the latest TypeScript source.
30+
the demo page always stays up to date while editing TypeScript source code.
31+
32+
Usage
33+
-----
34+
35+
```TypeScript
36+
import '@phosphor/dragdrop/style/index.css!';
37+
import '@phosphor/widgets/style/index.css!';
38+
import 'phosphor-float-area/style/index.css!';
39+
40+
import { Widget, DockPanel } from '@phosphor/widgets';
41+
import { FloatArea } from 'phosphor-float-area';
42+
43+
const area = new FloatArea();
44+
const dock = new DockPanel();
45+
46+
dock.addWidget(area);
47+
dock.addWidget(new Widget(), { mode: 'split-left', ref: area });
48+
dock.addWidget(new Widget(), { mode: 'split-right', ref: area });
49+
50+
Widget.attach(dock, document.body);
51+
```
3052

3153
Project structure
3254
-----------------

0 commit comments

Comments
 (0)