Socket
Socket
Sign inDemoInstall

ak-layer

Package Overview
Dependencies
3
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

ak-layer


Version published
Maintainers
1
Created

Readme

Source

Layer

Synopsis

A container responsible for the positioning of an element on a page

Setup and install

npm install ak-layer

Using the definition

The ak-layer package exports the Layer skate component:

import Layer from 'ak-layer';

const myLayer = new Layer();

Component API

Constructor

The definition for the Layer component.

HTML Example

<ak-layer target="#target"></ak-layer>

JS Example

import Layer from 'ak-layer';
const myLayer = new Layer();

layer.position : string

Position of a layer relative to it's target. The position attribute takes two positional arguments in the format position="edge edge-position", where edge specifies what edge to align the layer to, and edge-position specifies where on that edge the layer should appear. Refer to the table below for examples:

top lefttop centertop right
left topright top
left middletargetright middle
left bottomright bottom
bottom leftbottom centerbottom right

Kind: instance property of Layer
Default: "right middle"
HTML Example

<ak-layer position="top left"></ak-layer>

JS Example

layer.position = 'top left';

layer.constrain : String

Constrain a layer to a scrollable parent or the window

Kind: instance property of Layer
Default: 'window'
HTML Example

<ak-layer constrain="scrollParent"></ak-layer>

JS Example

layer.constrain = 'scrollParent'

layer.target : String

Target of a layer. Selector or element on a page relative to which layer should be positioned

Kind: instance property of Layer
HTML Example

<ak-layer target="#target"></ak-layer>

JS Example

layer.target = document.body.querySelector('#target');

JS Example

layer.target = '#target'

FAQs

Last updated on 22 Jul 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc