Socket
Book a DemoInstallSign in
Socket

anchors-away-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchors-away-js

A fluid positioning JavaScript framework for UI design.

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Anchors Away

A fluid positioning JavaScript framework for UI design.

Installation

npm install anchors-away-js

Usage

import layoutItems from 'anchors-away-js'

layoutItems({
  x: 0,
  y: 0,
  items: [
    { width: 16, height: 16 }, // { x, y, width, height }
    { width: 32, height: 16 },
    { width: 16, height: 32 },
    { width: 32, height: 32 },
    { width: 16, height: 16 }
  ],
  width: 300,
  height: 300,
  margin: 10,
  anchors: 'top left', // top, left, bottom, right
  direction: 'row' // row, column
})

// Result
/*
[
  {
    "x": 74,
    "y": 142,
    "width": 16,
    "height": 16
  },
  {
    "x": 100,
    "y": 142,
    "width": 32,
    "height": 16
  },
  {
    "x": 142,
    "y": 134,
    "width": 16,
    "height": 32
  },
  {
    "x": 168,
    "y": 134,
    "width": 32,
    "height": 32
  },
  {
    "x": 210,
    "y": 142,
    "width": 16,
    "height": 16
  }
]
*/

Keywords

ui

FAQs

Package last updated on 20 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts