aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorGravatar github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 2025-06-05 12:45:02 +0000
committerGravatar github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 2025-06-05 12:45:02 +0000
commitee1d83ccf2ede53cb7198d7694545704ba14d410 (patch)
tree0b93dc64c37a394baf2f50539afcef6471c0f566 /src/app.ts
downloadastro-examples/toolbar-app.tar.gz
astro-examples/toolbar-app.tar.zst
astro-examples/toolbar-app.zip
Sync from 0947a69192ad6820970902c7c951fb0cf31fcf4bexamples/toolbar-app
Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app.ts b/src/app.ts
new file mode 100644
index 000000000..72bd4772d
--- /dev/null
+++ b/src/app.ts
@@ -0,0 +1,16 @@
+import { defineToolbarApp } from 'astro/toolbar';
+
+// Guide: https://docs.astro.build/en/recipes/making-toolbar-apps/
+// API Reference: https://docs.astro.build/en/reference/dev-toolbar-app-reference/
+export default defineToolbarApp({
+ init(canvas) {
+ const astroWindow = document.createElement('astro-dev-toolbar-window');
+
+ const text = document.createElement('p');
+ text.textContent = 'Hello, Astro!';
+
+ astroWindow.append(text);
+
+ canvas.append(astroWindow);
+ },
+});