1.2.5 • Published 12 months ago

flogmodal v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

flogmodal

A react modal

NPM JavaScript Style Guide

Install

npm install --save flogmodal

Usage

With the link between a button and the flogmodal

import React, { Component } from 'react'

import { FlogModalComponent } from 'flogmodal'
import 'flogmodal/dist/index.css'

const App = () => {
  const [mymodal, setMymodal] = useState(false)

  return (
    <div style={{ display: 'flex' }}>
      <button
        onClick={() => {
          setMymodal(true)
        }}
      >
        your button
      </button>
      <FlogModalComponent
        visibility={mymodal}
        titleLabel='Oooh modal'
        hasDefaultButton='true'
        content='Content'
      />
    </div>
  )
}

With the linkType (link, button or image)

import React, { Component } from 'react'

import { FlogModalComponent } from 'flogmodal'
import 'flogmodal/dist/index.css'

const App = () => {
  return (
    <div style={{ display: 'flex' }}>
      <FlogModalComponent
        linkType='link'
        buttonLabel='Open a great modal'
        titleLabel='Great modal'
        hasDefaultButton='true'
        content='Content'
        linkTitle='Open the modal with a link'
      />
      <FlogModalComponent
        linkType='button'
        buttonLabel='Modal with no title'
        content='You can custon the content of the modal'
        linkTitle='Open the modal with a button'
      />
      <FlogModalComponent
        linkType='image'
        buttonLabel='Custom buttons'
        titleLabel='Modal with custom buttons'
        hasDefaultButton='true'
        cancelLabel='Annuler'
        saveLabel='Envoyer'
        imageSrc='https://cdn.cdnlogo.com/logos/r/63/react.svg'
        imageHeight='100px'
        imageWidth='100px'
        imageAlt='React Logo'
        linkTitle='Open the modal with a image'
      />
    </div>
  )
}

Parameters

AttributValuesDefault valueMandatoryDescription
linkTypeimage,link or buttonnoneno
visibilitynonenoto be used when you want to link a another component like a button to the flogmodal
linkTitleStringnonenoto be used with the linkType=link
buttonLabelString""noto be used with the linkType=button
titleLabelString""nofor all linkType
hasDefaultButtonBooleanfor all linkType
cancelLabelStringCancelnofor all linkType
saveLabelStringSavenofor all linkType
imageSrcStringnonenoto be used with the linkType=image
imageHeightStringnonenoto be used with the linkType=image
imageWidthStringnonenoto be used with the linkType=image
imageAltStringnonenoto be used with the linkType=image
contentString or htmlnonenofor all linkType

License

MIT © flogus

1.2.5

12 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago