@react-above/modal-theme-default
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

@react-above/modal-theme-default

Installation

$ yarn add @react-above/modal-theme-default

Usage

1. Create Modal component

/* Somewhere in your UI layer.. */

import { createModal } from '@react-above/modal'
import { ThemeDefault } from '@react-above/modal-theme-default'

export const Modal = createModal({
  theme: ThemeDefault(),
  // ...
})

2. Use anywhere

import { Modal } from '@app/ui'

<Modal isOpen={isOpen} close={close}>
  <Modal.Surface>
    <Modal.Header title="My modal" close={close} />
    <Modal.Body>My modal text</Modal.Body>
  </Modal.Surface>
</Modal>

API

Modal.Surface

The container for your modal content

interface Props {
  /*
   * true - fill fullscreen OR more (depends on content size)
   * 'strict' - fill fullscreen precisely (you should manage overflow inside)
   */
  fullscreen?: boolean | 'strict'
}

Modal.Header

The modal's top part

interface Props {
  title?: string
  close?: () => void
}

Modal.Body

The modal's content part

interface Props {}

Readme

Keywords

none

Package Sidebar

Install

npm i @react-above/modal-theme-default

Weekly Downloads

0

Version

0.1.8

License

MIT

Unpacked Size

18.8 kB

Total Files

7

Last publish

Collaborators

  • risenforces