Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ak-blanket

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ak-blanket

ak-blanket webcomponent

  • 3.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by7.69%
Maintainers
1
Weekly downloads
 
Created
Source

Commitizen friendly semantic-release Bug tracker Support forum

Blanket

The main purpose of the blanket component is to provide the overlay layer for components such as a modal dialog or a tooltip.

Example blanket

Try it out

Interact with a live demo of the ak-blanket component.

Installation

npm install ak-blanket

Using the component

HTML

The ak-blanket package exports the Blanket Skate component.

Import the component in your JS resource:

bundle.js
import 'ak-blanket';

Now you can use the defined tag in your HTML markup, for example:

index.html
<html>
<head>
  <script src="bundle.js"></script>
</head>
<body>
  <!-- ... -->
  <ak-blanket></ak-blanket>
</body>
with other components

The main purpose of the blanket component is to provide the overlay layer for components such as modal dialog or tooltip. It can be achieved like this:

define('modal-dialog-component', () => {
 attached(elem) {
   window.addEventListener('activate', doSomethingWhenBlanketClicked(elem));
 },
 detached(elem) {
   window.removeEventListener('activate', doSomethingWhenBlanketClicked(elem));
 },
 render(elem) {
   return (
     <div>
       <ak-blanket clickable tinted />
       <div>the rest of the awesome component here</div>
     </div>
   );
 })

It emits the 'activate' event when clicked/touched. Blanket component doesn't have the z-index style, so make sure you put it into an appropriate DOM position. For the purpose of simplicity blanket doesn't have any show/hide functionality. Since the main use of it suppose to be inside popup elements it would appear/disappear with the parent element.

React

This is a standard web component, if you want to use it in your React app, use the Skate.js React integration.

import Blanket from 'ak-blanket';
import reactify from 'skatejs-react-integration';

const ReactComponent = reactify(Blanket, {});

ReactDOM.render(<ReactComponent />, container);

Blanket

Kind: global class

new Blanket()

Create instances of the component programmatically, or using markup.

JS Example

import Blanket from 'ak-blanket';
const component = new Blanket();

blanket.tinted : Boolean

Is blanket grey with opacity or transparent. By default it's transparent.

Kind: instance property of Blanket
Default: false
HTML Example

<ak-blanket tinted></ak-blanket>

JS Example

component.tinted = true

blanket.clickable : Boolean

Whether the blanket is clickable.

Kind: instance property of Blanket
Default: false
Emits: activate
HTML Example

<ak-blanket clickable></ak-blanket>

JS Example

component.clickable = true

"activate"

This event is emitted when the blanket is clicked. The emission of this event can be controlled by the clickable property.

Kind: event emitted by Blanket

Support and feedback

We're here to help!

Let us know what you think of our components and docs, your feedback is really important for us.

Community support

Ask a question in our forum.

Check if someone has already asked the same question before.

Create a support ticket

Are you in trouble? Let us know!

FAQs

Package last updated on 17 Oct 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc