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

simple-callout

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-callout

A simple callout box/tooltip

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Simple Callout

Build status Bower dependencies Version Size
Cross browser test status

A simple, style-agnostic callout box that can be shown and hidden from any position.

Installation & usage

Install simple-callout with Bower

$ bower install simple-callout --save

Import it into the <head> of your page

<link rel="import" href="/bower_components/simple-callout/simple-callout.html">

Then use simple-callout in your project

<simple-callout arrow="top left">
  <span>My callout contents</span>
</simple-callout>

To ensure that the content inside the callout is layered on top of the callout's arrow, always use elements rather than just text nodes (eg: <span>text</span> instead of text);

Polyfills for cross-browser support

Simple callout relies on emerging standards, and you will need to include polyfills for cross-browser support:

<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>

--

Options

PropertyTypeDefaultDescription
activeBooleanfalseControls whether the callout is visible or not
originStringundefinedThe origin position that the callout expands from. Can be any combination of top/bottom/left/right/center
arrowBooleanfalseWhether the callout has a little arrow at its origin
noOutsideClickBooleanfalseDisable closing the callout on outside clicks
noEscapeBooleanfalseDisable closing the callout on escape key presses
<simple-callout origin="bottom center" arrow no-escape></simple-callout> 

Methods

MethodArgumentsDescription
open()noneUtility method to open the callout
close()noneUtility method to close the callout
toggle()noneUtility method to toggle the callout

Styling

In addition to styling the callout directly, you can also set these CSS properties

PropertyDefaultDescription
--simple-callout-arrow-size8pxSize of the callout's arrow

Apply properties on simple-callout

simple-callout {
  --simple-callout-arrow-size: 12px;
}

--

MIT © Simpla

Keywords

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