furl
Getting startedDesignComponents
Design
Design GuidelinesTypography SystemLayout SystemColor palettesCustomization
Components
ComponentsAccordionAlertAnchorAudioAvatarBadgeBreadcrumbsButtonButtonGroupCalendarCardCollapseContextButtonDividerDropdownFooterFormGraphGridHyperlinkIconIframeImageInputItemLayoutListLoaderMediaObjectMenuModalNotificationPaginationPopoverProgressSearchStepsSwitchTableTabsTooltipTypographyVideo

Modal

Modals provide a way to display dialogs to your users.

Examples

import React from 'react';
import ReactDOM from 'react-dom';
import { ModalCenter, Modal, ModalSection, Button } from 'furl-components';

const modalCenterRef = React.createRef();

ReactDOM.render(
  <div>
    <ModalCenter ref={modalCenterRef} />
    <Button color='primary' onClick={() => {
      modalCenterRef.current.setContent(
        <Modal>
          <ModalSection>
            <h5>Howdy, there!</h5>
            <p>Nice to see you here. You can learn more about our website by visiting more pages.</p>
            <Button color='primary' onClick={() => modalCenterRef.current.hide()}>Take me back</Button>
          </ModalSection>
        </Modal>
      );

      modalCenterRef.current.show();
    }}>Open modal dialog</Button>
  </div>, 
  document.getElementById('root')
);

API

ModalCenter props
Property Description Type Default
ref modal center ref React Ref
isOpen modal center open state boolean false
ModalCenter ref methods
Method Description
setContent() set content of the modal center
show() show content of the modal center
hide() hide content of the modal center
ModalSection props
Property Description Type Default
media modal section media url string
height modal section height int/string 'auto'

Notes

  • It is highly recommended to provide a ref for your ModalCenter via the use of React.createRef(). ModalCenter should only be used once in your app and it should be reused via ref.current for multiple modal dialogs.
  • A ModalCenter only accepts children of the Modal component type, set either normally or via the setContent method.
  • A Modal only accepts children of the ModalSection component type.
  • The ModalSection’s height accepts any valid CSS value, including CSS variables, and will only be applied if media is specified.
  • If a ModalSection has a media prop specified, it should not have any children.

furl was designed and developed by Angelos Chalaris © 2019
Documentation generated using Gatsby, hosting by Netlify