1.1.8 • Published 4 years ago

floaty v1.1.8

Weekly downloads
40
License
MIT
Repository
github
Last release
4 years ago

floaty

Rearrangeable panels in React.

Installation

Node.js

npm install --save floaty

Examples

npm run start:dev

Live example on CodePen.

Introduction

This part will introduce the concepts and capabilities of floaty.

Concepts

floaty is a React component. It renders a layout. You must specify the layout in the props of the floaty React component.

The layout is made up from smaller building blocks. Each building block is also rendered by its own React component. A layout is made up from the following building blocks:

  • Rows.
  • Columns.
  • Stacks.
  • Tabs.

A row represents a vertically separated panel. A column represents a horizontally separated panel. A stack represents a "depth" separated panel. A tab represents user generated content; this is where you can render actual content.

The following image demonstrates these concepts:

npm.io

In the above image, the layout is build up as follows:

  • A row separating the left sections (1) and right sections (2, 3, 4).
    • Left: a stack with 3 tabs (5) in the left section.
    • Right: a column with 3 items (2, 3, 4) in the right section.
      • Top: a stack with 1 tab (2).
      • Middle: a stack with 1 tab (3).
      • Bottom: a stack with 1 tab (4).

When it comes to rows, columns and stacks, they form a layout tree. The bottom elements (or "leaf" elements) of the layout tree must always be stacks, and a stack is always a leaf element (therefore it cannot have child rows or columns).

A stack can contain multiple tabs. Each tab has a label and content. When you use floaty, you must provide React components to render the label and content parts of the layout.

Capabilities

You can give floaty a static layout and it will render that layout.

It is also possible to move tabs around. This can be done programmatically or with user interactions.

For example: the user can use their mouse to drag a tab around. When the user drops the tab it will be placed into the layout. During the dragging process, the tab is floating. Dropping the floating tab on the content of an existing tab will change the layout. Depending on where exactly the floating tab was dropped, the new layout can have a new row, column or stack.

Tabs can also be closed. This can also be done programatically or with user interactions.

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.22

5 years ago

0.3.21

5 years ago

0.3.20

6 years ago

0.3.19

6 years ago

0.3.18

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago