haradakunihiko / react-confirm

Small library which makes your Dialog component callable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: 'ProceedVerb' as default options

EliotSlevin opened this issue · comments

First off, love this library! Just implemented it, works great.

One of the easiest ways to improve the UX of confirm/deny dialogues is having a more descriptive verb. Instead of the success button saying something generic like 'ok' or 'yes', using a verb or complex verb (e.g. 'delete' or 'remove draft post').

This is super easy to implement with the options prop which is already supported - but I think it's such a UX win that 'ProceedVerb' should be implemented by default, and suggested in the installation guide. Ideal end usage in my mind is:

 confirm('Are you sure you want to remove that kitten?', 'Remove {catname}`).then(....

Thanks, and sorry for the reply being late.
I'm not quite sure about your proposal since this library does not include any UI library.

Actually,

 confirm('Are you sure you want to remove that kitten?', 'Remove {catname}`).then(....

This is exactly I do using this library, but this should be depend on UI.
Maybe, example and Readme are not clear?

If you make a PR about this issue. I would be very glad!