Collection of customizable DOM dialogs.
For usage, see the example code.
npm i daniela
or
<link rel="stylesheet" href="https://unpkg.com/daniela/dist/daniela.min.css">
<script src="https://unpkg.com/daniela/dist/daniela.min.js"></script>
You can override the following CSS variables:
--daniela-background
(default: #000
)
--daniela-foreground
(default: #EEE
)
--daniela-z-dialog
(the dialog z-index
, default: 20
)
--daniela-z-toast
(the toast z-index
, default: 30
)
--daniela-radii
(for the border-radius
, default: 4pt
)
Display a message by the given time.
The message to be shown.
The time on screen (ms)
The default value is 3000
Ask the user a question.
The question to be asked (question mark not included).
The only possible answers are Yes
or No
.
Read input from the user.
The title of the dialog.
The input label.
The default value is empty.
The validation function take as parameter the input value and check if is valid or not.
By default, it checks that the value is not empty.