Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-new-window

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-new-window

popup new browser window with react

  • 0.1.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5K
decreased by-2.55%
Maintainers
1
Weekly downloads
 
Created
Source

rc-new-window


React New Window Component to show content in a popup browser window. Ported from react-new-window

NPM version npm download

Development

npm install
npm start

Example

online example: https://ticlo.github.io/rc-new-window/

install

rc-new-window

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import NewWindow from 'rc-new-window';

ReactDOM.render((
  <NewWindow>
    Content to show in the new window
  </NewWindow>
), container);

API

props

nametypedefaultdescription
urlStringUse url instead of children content
nameStringName of new window
titleStringtitle of current windowTitle of new window
copyStylesBooleantrueCopy the styles from main window
widthNumber640Window inner width
heightNumber480Window inner height
initPopupInnerRectFunctioninit the window client area
return {left,top,width,height}
initPopupOuterRectFunctioninit the window position and size
return {left,top,width,height}
topNumbercenter of current windowWindow position
onOpen(w: Window) => voidcallback when window is opened
onClose() => voidcallback when window is closed
onBlock() => voidcallback when window.open failed

License

rc-new-window is released under the Apache license version 2.0.

Keywords

FAQs

Package last updated on 20 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc