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

ampersand-modal-view

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-modal-view

Modal view for Ampersand.js

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ampersand-modal-view

A modal popup view for Ampersand.js.

Install

npm install ampersand-modal-view

Example

var ModalView = require('ampersand-modal-view');
var MyCustomView = require('some-custom-view');

var modalContent = new MyCustomView(options);
var modal = new ModalView({
  title: 'Title of My Modal',
  description: 'a description, mostly for screenreaders',
  contentView: modalContent
});

modal.openIn('body');

API Reference

constructor/initialize new AmpersandModalView([opts])

Creates a new modal view.

opts
  • title, the title of the modal. Set in a h1. Used as the aria label.
  • description, sets a description for screenreaders. Used as the aria description
  • close, allows you to change the screenreader label for the close button.
  • contentView, any object following the Ampersand view conventions. The content of the modal.

open in modalView.openIn(container)

Opens the modal in container.

  • container, a string selector or a DOM node to show the modal inside. Most cases this will be body.

Accessibility

This modal takes great care to be accessible for people using a screenreader. The inspiration for the implementation comes from these two great articles.

License

MIT

Keywords

FAQs

Package last updated on 09 Feb 2015

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