Skip to content

Human/AI Widget

The Human/AI widget is a floating toggle that lets visitors switch between the normal page and its AI-readable markdown version.

When a visitor clicks AI, the widget:

  1. Fetches the .md file for the current page
  2. Falls back to extracting markdown from the live DOM if no .md exists
  3. Displays the markdown in a slide-out panel
  4. Offers copy-to-clipboard and download actions

Framework plugins (Astro, Vite, Nuxt, Angular) inject the widget automatically. No extra code needed.

For Next.js or other manual setups, create a client component:

'use client';
import { useEffect } from 'react';
export function AeoWidgetLoader() {
useEffect(() => {
import('aeo.js/widget').then(({ AeoWidget }) => {
new AeoWidget({
config: {
title: 'My Site',
url: 'https://mysite.com',
widget: { enabled: true, position: 'bottom-right' },
},
});
});
}, []);
return null;
}

aeo.js ships React, Vue, and Svelte wrapper components:

import { AeoReactWidget } from 'aeo.js/react';
<AeoReactWidget config={{ title: 'My Site', url: 'https://mysite.com' }} />
<script setup>
import { AeoVueWidget } from 'aeo.js/vue';
</script>
<template>
<AeoVueWidget :config="{ title: 'My Site', url: 'https://mysite.com' }" />
</template>
widget: {
enabled: true,
position: 'bottom-right', // 'bottom-left' | 'top-right' | 'top-left'
size: 'default', // 'small' | 'icon-only'
humanLabel: 'Human',
aiLabel: 'AI',
showBadge: true,
theme: {
background: 'rgba(18, 18, 24, 0.9)',
text: '#C0C0C5',
accent: '#E8E8EA',
badge: '#4ADE80',
},
}
DefaultSmallIcon
Default widgetSmall widgetIcon widget
size: 'default'size: 'small'size: 'icon-only'
Full labels with iconsCompact — ~30% smallerJust icons, no labels