Frameworks

Typed components for React, Vue, Nuxt & more.

Thin wrappers over the same widget script — they inject it and clean up on unmount, nothing more. Svelte, SolidJS, Astro and Angular use the framework-free loader. The widget itself stays framework-free.

One install

Pick your package.

All three wrap the same ~12KB widget-core. Pass yoursiteId and you’re live.

npm i @askthis/react   # React / Next.js
npm i @askthis/vue     # Vue 3
npm i @askthis/embed   # framework-free loader

React

@askthis/react

A typed <AskThis /> component. Renders a container and mounts the widget into it.

import { AskThis } from "@askthis/react";

export function Share() {
  return <AskThis siteId="YOUR_SITE_ID" />;
}

Next.js

@askthis/react

Same package — the App Router just needs it in a client component.

"use client";
import { AskThis } from "@askthis/react";

export function Share() {
  return <AskThis siteId="YOUR_SITE_ID" />;
}

Vue 3

@askthis/vue

A <AskThis> component for Vue 3 single-file components.

<script setup lang="ts">
import { AskThis } from "@askthis/vue";
</script>

<template>
  <AskThis site-id="YOUR_SITE_ID" />
</template>

Nuxt

@askthis/vue

Nuxt is Vue 3 — the same component, wrapped in <ClientOnly> so it mounts on the client.

<template>
  <ClientOnly>
    <AskThis site-id="YOUR_SITE_ID" />
  </ClientOnly>
</template>

<script setup lang="ts">
import { AskThis } from "@askthis/vue";
</script>

Svelte / SvelteKit

@askthis/embed

Mount with the framework-free loader in onMount; return the cleanup fn on destroy.

<script lang="ts">
  import { onMount } from "svelte";
  import { createWidget } from "@askthis/embed";
  let el;
  onMount(() => createWidget(el, { siteId: "YOUR_SITE_ID" }));
</script>

<div bind:this={el}></div>

SolidJS

@askthis/embed

Mount in onMount and hand the cleanup fn to onCleanup.

import { onMount, onCleanup } from "solid-js";
import { createWidget } from "@askthis/embed";

export function Share() {
  let el;
  onMount(() => onCleanup(createWidget(el, { siteId: "YOUR_SITE_ID" })));
  return <div ref={el} />;
}

Astro

script embed

Drop the universal script in your layout — or use a framework island with the package above.

---
// src/layouts/Base.astro
---
<script async
  src="https://cdn.askthis.io/widget.js"
  data-site-id="YOUR_SITE_ID"></script>

Framework-free loader

@askthis/embed

For Angular or any other framework — inject the widget into any element, get a cleanup fn.

import { createWidget } from "@askthis/embed";

const cleanup = createWidget(el, { siteId: "YOUR_SITE_ID" });
// later: cleanup();

Not using a framework? See Hugo, Jekyll & plain HTML, or the full install guide.