One-time PWA install sheet: native prompt or the steps.

Mounted once in the root layout, it opens by itself the first time the browser can install the app: the native prompt where there is one, the Share steps on iOS, the browser menu steps elsewhere. storageKey remembers it was shown so it never comes back.

Usage

+layout.svelte
<script lang="ts">
	import InstallPrompt from "@orochibraru/ui/blocks/install-prompt";

	const { children } = $props();
</script>

{@render children()}
<InstallPrompt appName="Acme" storageKey="acme-install-prompt">
	{#snippet brand()}
		<img src="/icon-192.png" alt="" class="size-14 rounded-2xl" />
	{/snippet}
</InstallPrompt>