1.0.6 • Published 1 year ago

p14lib v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

React modal component

A accessible modal dialog component for React.JS

React minimum version

Installation

npm install p14lib

Usage

import React from 'react';
import { Modal } from 'p14lib';

export default function Index() {
	const [opened, setOpened] = useState(false);

	return (
		<Modal styles={{body: {backgroundColor: '#000', color: '#FFF'}}} opened={opened} onClose={() => setOpened(false)}>
			<p style={{margin:'8px 6px'}}>Modal opened !</p>
		</Modal>
	);
}

Props

PropTypeDefaultDescription
openedbooleanfalseIf true, the modal is open
onClosefunction() => {}Callback fired when the component requests to be closed.
titleReactNode or undefinedundefinedModal title
styles.rootobject{}Styles to apply to the modal
styles.overlayobject{}Styles to apply to the modal overlay
styles.contentobject{}Styles to apply to the modal content
styles.closeobject{}Styles to apply to the modal close button
styles.titleobject{}Styles to apply to the modal title
styles.bodyobject{}Styles to apply to the modal body
styles.headerobject{}Styles to apply to the modal header
1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago