plugins/smedjen/skills/expo-dom-components/SKILL.md
Web components in native Expo context — DOM component bridges, WebView patterns, and hybrid rendering
npx skillsauth add hjemmesidekongen/ai expo-dom-componentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expo SDK 52+ lets you render web content inside a native view using a 'use dom' directive. The file is bundled as a separate web bundle and mounted in an embedded WebView — no manual wiring required.
'use dom' Directive'use dom' must be the first line of the component file (before imports):
'use dom';
export default function RichEditor({ content }: { content: string }) {
return <div contentEditable suppressContentEditableWarning>{content}</div>;
}
Import and use it in native code like any React Native component. The bridge handles serialization.
Props cross a serialization boundary — pass primitives and plain objects only. Function props work for web→native callbacks; the bridge serializes the call automatically.
Use DOM components for self-contained web UI embedded in a native screen: rich text editors, D3/Chart.js visualizations, markdown renderers, or any web-only library with no RN equivalent.
Use react-native-webview directly when you need full control: injectedJavaScript, onMessage, remote source.uri, or navigation hooks.
DOM components run in a separate JS context — they don't share React state with native. Coordinate through props (native→web) and callbacks (web→native). For complex sync, use a shared data layer (AsyncStorage, MMKV, or server) as source of truth.
Each DOM component spawns a WebView process. Keep the count low — prefer one DOM component managing its own internal complexity over multiple small ones mounted simultaneously.
See references/process.md for WebView patterns, injectedJavaScript usage, communication protocols, debugging, and anti-patterns.
development
Creates a brand from scratch through market research and interactive sparring. Runs competitive research via Perplexity, then guides the user through positioning, audience, voice, values, and content pillars. Produces the full brand guideline set at .ai/brand/{name}/. Use when building a new brand, defining brand strategy for a product, or when /våbenskjold:create is invoked.
testing
Loads brand guidelines from .ai/brand/{name}/ and makes them available to the current context. Progressive disclosure: L1 confirms brand exists, L2 loads summary, L3 loads specific files on demand. Use when a downstream skill or user needs brand context, or when /våbenskjold:apply is invoked.
documentation
Guided reinvention of an existing brand guideline. Loads current brand from .ai/brand/{name}/, identifies what to keep vs change, and walks the user through targeted evolution. Preserves brand equity while updating positioning, voice, or values. Use when refreshing a brand or when /våbenskjold:evolve is invoked.
development
Codifies an existing brand from materials, samples, and references. Analyzes provided content to extract voice patterns, values, and positioning. Produces the same guideline format as brand-strategy. Use when a brand already exists but isn't documented, or when /våbenskjold:audit is invoked.