summaryrefslogtreecommitdiff
path: root/examples/toolbar-app/src/app.ts
blob: 72bd4772d7edc0617169764ecaca21c38ecad7ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
	},
});