Socket
Book a DemoInstallSign in
Socket

electron-osx-prompt

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-osx-prompt

Electron macOS-style prompts.

1.4.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

electron-osx-prompts

Electron macOS-style prompts. Intended for use on a mac.
Behaves like a modal that blocks other interaction.

Install

$ npm install electron-osx-prompt

Usage

// From renderer or main process, doesn't matter
const userPrompt = require('electron-osx-prompt');

const icon = __dirname + '/icon.png';

userPrompt('Label text', 'Placeholder text', icon)
  .then(input => {
    console.log(input);
  })
  .catch(err => {
    console.log(err);
  });

Options

You can change the label text and the textbox placeholder text.
You can also provide a PNG or JPEG image for the prompt icon. It's size should be about 60 x 60 px.

userPrompt([label, placeholder, icon])

ParameterTypeDescriptionDefault
labelstringThe label text of the input field.'Please enter a value'
placeholderstringThe placeholder text inside the input field.''
iconstringPath to your custom (app) icon.Electron's default icon.

Returns a Promise with the user input. Clicking Cancel will return null.

Licence

MIT © Peter Freeman

Uses css from photon by @connors

Keywords

electron

FAQs

Package last updated on 14 Jan 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.