Javascript-Confirm-Dialogue - Simple Confirm Dialogue with 3 Options. Vanilla JS

Related tags

React js-dialog-box
Overview

Javascript Dialog Box

v1.0.0

Javascript Dialog Box is a simple to use library for making dialog boxes in pure Javscript. It comes with the following features

  • Minial mark up required
  • Async use for response handling
  • 3 button, true, false (optional) & neutral (optional)

New Features!

  • Default layout, add only invoking code to show an error message

Basic Use

By default the dialog will show an ok button and an error message.

const dialog = new DialogBox();

Optional Parameters

trueButtonText: 'Message to show on the positive button'
falseButtonText: 'Message to show on the negative button'
neutralButtonText: 'Message to show on the neutral button'
messageText: 'Message to show in the body of the dialog'
titleText: 'Title text int he dialog'

Full Use

async () => {
    const dialog = new DialogBox({
    	trueButtonText: "Yes",
    	falseButtonText: "No",
    	neutralButtonText: 'Cancel',
    	messageText: "Do you want to update both tables",
    	titleText: "Update"
    });
    if (await dialog.respond()) {
    	updateBothTables();
    } else {
        updateOneTable();
    };
}
You might also like...

⚡️ Simple, Modular & Accessible UI Components for your React Applications

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Build Accessible React Apps with Speed ⚡️ Chakra UI provides a set of accessible, reusable, and composable React components that make it super easy to

Jan 4, 2023

🐐 Simple and complete React DOM testing utilities that encourage good testing practices.

🐐 Simple and complete React DOM testing utilities that encourage good testing practices.

React Testing Library Simple and complete React DOM testing utilities that encourage good testing practices. Read The Docs | Edit the docs Table of Co

Jan 4, 2023

Simple React Bootstrap 4 components

Simple React Bootstrap 4 components

reactstrap Stateless React Components for Bootstrap 4. Getting Started Follow the create-react-app instructions to get started and then follow the rea

Jan 5, 2023

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

downshift 🏎 Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components. Read the docs | See

Dec 28, 2022

A simple tool that tells you what food is safe for your dog.

A simple tool that tells you what food is safe for your dog.

Can My Dog Eat A simple tool that tells you what food is safe for your dog. View website Features Can My Dog Eat is a simple website where you can loo

Dec 11, 2022

Very simple app to decode your Vaccination Proof QR Code (such as the one provided by government of Quebec) - Compatible with SHC (Smart Health Card standard)

Very simple app to decode your Vaccination Proof QR Code (such as the one provided by government of Quebec) - Compatible with SHC (Smart Health Card standard)

shc-covid19-decoder Visit simple hosted version on your phone (does NOT transmit any data, all remains in your browser) https://fproulx.github.io/shc-

Sep 23, 2022

simple static website generator

mkweb mkweb is a simple static website generator for NodeJS Features: Simple and fast Templates (currently hard coded to "template.html") Markdown wit

Nov 6, 2022

A simple PWA to scan your EU digital COVID Certificate and generate a passbook from it

COVID-19 passbook Generator The aim of this project is to let a user scan a EU Digital COVID Certificate with their smartphone, and generate a passboo

Nov 11, 2022

A portfolio built in React and NextJS. Simple, clean, and fast.

A portfolio built in React and NextJS. Simple, clean, and fast.

Personal Portfolio A portfolio built in React and NextJS. Simple, clean and fast. Note: The logo and banner used in the project are my intellectual pr

Jan 2, 2023
Comments
  • [Proposal] Add package.json

    [Proposal] Add package.json

    Hi Xn1ch1,

    "npm install Xn1ch1/js-dialog-box" currently results in an error: "npm ERR! premature close". This seems to be, because there is no package.json in the repository.

    Would you like your project to be extended by this file / usage possibility?

    Greets, Johnny

    opened by hardcoding 1
  • [Proposal] Add licence

    [Proposal] Add licence

    Hi Xn1ch1,

    I would like to use your code, but you did not set a licence. So I am not allowed to use or change it. Is that your intention or did you just miss this point?

    Greets, Johnny

    opened by hardcoding 1
Owner
Craig Hancock
Craig Hancock
vanilla-js lightweight custom HTML scrollbar

FakeScroll ⚡ lightweight custom-looking scrollbars 1.4KB gzipped (js) 4.0KB minified (js) 7.7KB unminified (js) ~20+ KB avarage similar scripts (unmin

Yair Even Or 353 Nov 23, 2022
Vanilla JS spring-interpolated values

Vanilla JS spring-interpolated values

Martin Wecke 4 Feb 28, 2022
Dynamic, theme-driven, style props for vanilla-extract.

Rainbow Sprinkles ?? Dynamic, theme-driven, style props for vanilla-extract. Rainbow sprinkles works similarly to @vanilla-extract/sprinkles. Like spr

Wayfair Tech 90 Dec 23, 2022
Dynamic, theme-driven, style props for vanilla-extract.

Rainbow Sprinkles ?? Dynamic, theme-driven, style props for vanilla-extract. Rainbow sprinkles works similarly to @vanilla-extract/sprinkles. Like spr

Wayfair Tech 37 May 11, 2022
A simple javascript utility for conditionally joining classNames together

Classnames A simple JavaScript utility for conditionally joining classNames together. Install with npm, Bower, or Yarn: # via npm npm install classnam

Jed Watson 16.3k Dec 31, 2022
Router JS 💽 Simple Router building in JavaScript

Router JS ?? Simple Router building in JavaScript

David Montaño Tamayo 1 Feb 12, 2022
A simple Web AI model deployment tool using JavaScript based on OpenCV.js and ONNXRuntime

WebAI.js 1. 简介 WebAI.js 是一个基于 OpenCV.js 和 ONNXRuntime 开发的一个 Web 前端 AI 模型部署工具 可通过在线体验网站 Hello WebAI.js 进行快速的体验试用 2. 特性 WebAI.js 支持 HTML script 标签引入和 no

AgentMaker 26 Nov 28, 2022
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Module SonarCloud Status ag-grid-community ag-grid-enterprise AG Grid AG Grid is a fully-featured and highly customizable JavaScript data grid. It del

AG Grid 9.5k Dec 30, 2022
Pickle tree - Javascript tree component made with pure javascript

Pickle Tree Pickle tree is a tree component written as completely pure javascript. Just send json file to object and have fun :-D Pickle tree does't n

Kadir Barış Bozat 17 Nov 13, 2022
Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Material-UI 83.6k Dec 30, 2022