From 83e236e34c03911392c327cd71a9813bac3db405 Mon Sep 17 00:00:00 2001 From: Maurits van Riezen <12109031+mousetail@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:37:25 +0100 Subject: [PATCH] [Docs] Fix documentation of onclick to make it clear 1) the data is not HTML escaped 2) there is also a href option alternative --- docs/src/components/toast.njk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/src/components/toast.njk b/docs/src/components/toast.njk index 31f9621..ad0f2c2 100644 --- a/docs/src/components/toast.njk +++ b/docs/src/components/toast.njk @@ -210,7 +210,9 @@ toc:
label Optional
The label of the cancel button. If not provided, the default label is "Dismiss".
onclick Optional
-
The onclick of the cancel button.
+
(string) The onclick of the action. Inserted literally into the HTML so you probably want to escape it yourself.
+
href Optional
+
(string) The href of the action. If present, the onclick will be a <a> element. Inserted literally into the HTML so you probably want to escape it yourself. Overrides conclick
cancel Optional
@@ -219,7 +221,7 @@ toc:
label Optional
The label of the cancel button. If not provided, the default label is "Dismiss".
onclick Optional
-
The onclick of the cancel button.
+
The onclick of the cancel button. Inserted literally into the HTML so you probably want to escape it yourself.
@@ -276,4 +278,4 @@ toc: { tab: "toaster()", panel: code_block(raw_code_toaster, "jinja", class="") }, { tab: "toast()", panel: code_block(raw_code_toast, "jinja", class="") } ] %} -{{ tabs(id="macros", tabsets=tabsets) }} \ No newline at end of file +{{ tabs(id="macros", tabsets=tabsets) }}