@blakfy/accessibility-widget-next
v2.0.0-alpha.1
Published
Next.js helpers for @blakfy/accessibility-widget — A11yServerHelper, A11yScript with FOUC protection
Readme
@blakfy/accessibility-widget-next
Next.js App Router helpers for @blakfy/accessibility-widget. Three tiny components — no client-side state, just glue.
⚠️ Alpha:
2.0.0-alpha.x. Public API kilitli değildir, breaking change gelebilir.@blakfy/accessibility-widgetile aynı major sürüme pinlenmesi önerilir.
Yükleme
pnpm add @blakfy/accessibility-widget-nextPeer dependency: next >= 14, react >= 18.
Bileşenler
A11yServerHelper— async RSC helper. Prefs cookie'sini okur,<html>'e spread edilecekdata-a11y-*attribute'ları döner (FOUC koruması).A11yScript—next/scriptwrapper. Widget IIFE bundle'ını jsDelivr'dan yükler ve kilitlidata-*config yüzeyini iletir. Alpha aşamasında pinli sürüme yüklenir; stabil sürüme geçtikten sonra@v2floating tag default olacak.A11yPreconnect— jsDelivr origin'i için<link rel="preconnect">ipucu.
Kullanım
// app/layout.tsx
import {
A11yServerHelper,
A11yScript,
A11yPreconnect,
} from '@blakfy/accessibility-widget-next';
export default async function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="tr" {...await A11yServerHelper()}>
<head>
<A11yPreconnect />
</head>
<body>
{children}
<A11yScript locale="tr" theme="auto" position="bottom-left" />
</body>
</html>
);
}Daha fazla
- Tam dokümantasyon: GitHub README
- Next.js entegrasyon detayı (Yol A vs Yol B, SSR FOUC pattern'leri, dev-pipe log endpoint'i): Kurulum bölümü
- Public API kontratı:
docs/STABLE-API.md - Lisans: MIT
