0.5.0 • Published 3 days ago

react-spaces v0.5.0

Weekly downloads
454
License
MIT
Repository
github
Last release
3 days ago

React Spaces

NPM Azure Pipelines

An easy to understand and nestable layout system, React Spaces allow you to divide a page or container into anchored, scrollable and resizable spaces enabling you to build desktop/mobile type user interfaces in the browser.

Rather than a library of visual UI components, Spaces are intended to be the reusable foundational blocks for laying out a UI which responds neatly to view port resizes leaving you to fill them with whatever components you want.

  • No styling to achieve simple or complex layouts.
  • Spaces know how to behave in relation to each other and resize accordingly.
  • Spaces don't have any visual element to them (even padding or margins). You can fill them with whatever you want.

Version 0.2.0 release - read release notes here.

View full documentation here.

Top level spaces

Used at the top level of all other spaces.

\<ViewPort \/>

This space will take over the full viewport of the browser window. Resizing the browser window will automatically adjust the size of this space and all the nested spaces.

\<Fixed />

This space can be given a height and optionally a width (by default it will size to 100% of it's container). All nested spaces will be contained within this fixed size space.

Anchored spaces

These can be used within the top-level spaces \<ViewPort /> and \<Fixed /> or nested within other spaces.

\<Left /> and \<Right />

A space anchored to the left or right of the parent container/space. A size can be specified in pixels or as a percentage to determine its width.

\<Top /> and \<Bottom />

A space anchored to the top or bottom of the parent container/space. A size can be specified in pixels or as a percentage to determine its height.

There are resizable versions of these components called \<LeftResizable />, \<RightResizable />, \<TopResizable /> and \<BottomResizable /> which allow the spaces to be resized from the outer edge by dragging with the mouse.

Other

\<Fill />

A space which consumes any available area left in the parent container/space taking into account any anchored spaces on every side.

\<Positioned />

A space which can be absolutely placed within a parent space either by top, left, width and height or by top, left, right and bottom.

\<Layer />

Layers allow you to create layers within a parent space, for example:

<ViewPort>
	<Layer zIndex="{0}"> <LeftResizable size="20%" /> // floating sidebar </Layer>
	<Layer zIndex="{1}">
		<Fill />
	</Layer>
</ViewPort>

\<Centered />

Centres the content of a space horizontally and vertically.

\<CenteredVertically />

Centres the content of a space vertically.

Getting started

To get started with React Spaces you need:

npm install react-spaces --save
import * as Spaces from "react-spaces";

View full documentation here.

Donation

If you find this library useful, consider making a small donation to fund a cup of coffee:

0.5.1-beta.1

3 days ago

0.5.1-beta.2

3 days ago

0.5.1-beta.7

3 days ago

0.5.1-beta.8

3 days ago

0.5.1-beta.5

3 days ago

0.5.1-beta.6

3 days ago

0.5.1-beta.3

3 days ago

0.5.1-beta.4

3 days ago

0.5.0-node-20x.1

12 days ago

0.5.0

12 days ago

0.4.2-node-20x.3

1 month ago

0.4.2-node-20x.2

1 month ago

0.4.2-node-20x.1

1 month ago

0.4.2-beta.3

8 months ago

0.4.2-beta.4

8 months ago

0.4.2-beta.1

1 year ago

0.4.2-beta.2

8 months ago

0.4.1-beta.2

1 year ago

0.4.1-beta.1

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.9

1 year ago

0.4.0-beta.1

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.3-beta-1

2 years ago

0.3.3-beta-2

2 years ago

0.3.3-beta-3

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.3

3 years ago

0.2.4

3 years ago

0.2.2

3 years ago

0.2.1-beta.2

3 years ago

0.2.1-beta.3

3 years ago

0.2.1-beta.1

3 years ago

0.2.1-beta.6

3 years ago

0.2.1-beta.7

3 years ago

0.2.1-beta.4

3 years ago

0.2.1-beta.5

3 years ago

0.2.1

3 years ago

0.2.1-beta.8

3 years ago

0.2.1-beta.9

3 years ago

0.2.0

3 years ago

0.2.0-beta.11

3 years ago

0.2.0-beta.10

3 years ago

0.2.0-beta.9

3 years ago

0.2.0-beta.6

3 years ago

0.2.0-beta.8

3 years ago

0.2.0-beta.7

3 years ago

0.2.0-beta.5

3 years ago

0.1.29

3 years ago

0.2.0-beta.4

3 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.2.0-beta.3

3 years ago

0.1.26

4 years ago

0.2.0-beta.2

4 years ago

0.2.0-beta.1

4 years ago

0.1.25

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.22

4 years ago

0.1.22-alpha.1

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.20-alpha.4

4 years ago

0.1.20-alpha.3

4 years ago

0.1.20-alpha.2

4 years ago

0.1.20-alpha.1

4 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16-beta.0

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago