Git Product home page Git Product logo

light-modal's Introduction

LightModal

Perfect Salesforce Lightning Modal Window based on SLDS Modal Guidelines.

Features

  • Using Escape or clicking outside modal area to close
  • Fade-in and fade-out animations
  • Supports multiple inheritance
  • 100% Lightning

Table of Contents

Examples

You can find running examples on Heroku.

Install

Copy src/aura/lightModal to yours src/aura Salesforce directory.

Usage

Component

<lightning:button label="My Modal" onclick="{!c.openMyModal}" variant="neutral" />

<c:lightModal aura:id="myModal" title="This is My Modal" isDirectional="true">
    Hello, World!
    <aura:set attribute="actions">
        <lightning:button label="Previous" onclick="{!c.closeMyModal}" variant="neutral" />
        <lightning:button label="Next" onclick="{!c.closeMyModal}" variant="brand" />
    </aura:set>
</c:lightModal>

Controller

({
    openMyModal: function(component, event, helper) {
        component.find('myModal').open();
    },

    closeMyModal: function(component, event, helper) {
        component.find('myModal').close();
    }
})

Documentation

Attributes

Attribute Type Required Description
title String false Title of the modal. Rendered at the top.
tagline Aura.Component[] false Paragraph under the title.
actions Aura.Component[] false The bottom of the modal.
class String false A CSS classes to be attached to the modal. Classes are added in addition to base styles.
isLarge Boolean false Specifies whether the modal should be extra wide. Default value is false.
isDirectional Boolean false Specifies whether the modal action buttons directional (one button aligned on the left and one on the right for example). Default value is false.
allowClose Boolean false Specifies whether the modal can be closed by clicking on the close icon or outside of the window. Default value is true.

Methods

  • open()
  • close()

License

MIT (c) Michal Vavra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.