Framework Packages β
The core @agent-layer-zero/dendrite package is framework-agnostic and ships only the headless runtime. For prebuilt UI there are three sibling packages β one for each major consumer shape.
@agent-layer-zero/dendrite-vue β
Vue 3 components + composables.
npm install @agent-layer-zero/dendrite @agent-layer-zero/dendrite-vue @agent-layer-zero/somaPeer deps: @agent-layer-zero/dendrite ^0.4.0, @agent-layer-zero/soma ^0.2.0, vue ^3.3.0.
Composables:
useNeuron(config, options?)β creates a Neuron with reactive state.options.enabledcan be set tofalseto skip creation (used when a widget receives an external Neuron).provideNeuron(config)/useProvidedNeuron()β provide/inject pattern for sharing a Neuron across components.tryUseProvidedNeuron()β soft-lookup variant that returnsnullinstead of throwing.useChatSession(source, options?)β extracts themessages/streamingContent/send/stoplogic used inside<ChatWidget>so custom layouts can reuse it.
Widgets (all accept an optional :neuron-state prop for background loading / multi-Neuron):
<ChatWidget>β integrated chat<ChatModal>β floating bubble + popup<ChatSidebar>β slide-in panel- Granular:
<MessageBubble>,<MessageList>,<Composer>,<ModelLoader>,<ErrorDisplay>,<EmptyState>,<MobileUnsupported>,<StreamingText>,<InferenceIndicator>
@agent-layer-zero/dendrite-react β
React 18/19 components and hooks with the same shape as the Vue package.
npm install @agent-layer-zero/dendrite @agent-layer-zero/dendrite-react @agent-layer-zero/somaPeer deps: @agent-layer-zero/dendrite ^0.4.0, @agent-layer-zero/soma ^0.2.0, react ^18 || ^19, react-dom ^18 || ^19.
Hooks:
useNeuron(config, options?)β same semantics as Vue;options.enabledfor conditional creation.<NeuronProvider config={...}>/useProvidedNeuron()β context-based sharing.tryUseProvidedNeuron()β soft-lookup variant.useChatSession(source, options?)β extracted chat-session hook.NeuronContextβ raw React context, for advanced use.
Components: same set as Vue with React conventions (onSend={...} callbacks instead of @send events). All integrated widgets (<ChatWidget>, <ChatModal>, <ChatSidebar>) accept an optional neuronState prop.
@agent-layer-zero/dendrite-ui β
Framework-agnostic Web Components. Works in any HTML page, Svelte, Astro, Angular β anywhere that supports custom elements (i.e. everywhere).
npm install @agent-layer-zero/dendrite @agent-layer-zero/dendrite-ui @agent-layer-zero/somaPeer deps: @agent-layer-zero/dendrite ^0.4.0, @agent-layer-zero/soma ^0.2.0.
Custom elements:
<alz-chat-widget>β integrated chat widget (auto-registered on import)
Primitives:
createNeuronHandle(config)β creates an observableNeuronHandlewith the same shape asuseNeuron's return but as a plain JS object withsubscribe(listener). Used to preload a Neuron at page boot and hand it to a widget later viawidget.attach(handle).NeuronHandletype β{ neuron, isLoading, isGenerating, loadPercent, loadText, error, ..., subscribe, destroy }
Usage:
<script type="module">
import { createNeuronHandle } from '@agent-layer-zero/dendrite-ui'
import '@agent-layer-zero/dendrite-ui' // registers <alz-chat-widget>
import '@agent-layer-zero/soma/chat-components.css'
const handle = createNeuronHandle({
modelId: 'gemma-2-2b-it-q4f16_1-MLC',
systemPrompt: 'You are a helpful assistant.',
})
customElements.whenDefined('alz-chat-widget').then(() => {
document.querySelector('alz-chat-widget').attach(handle)
})
</script>
<alz-chat-widget style="height: 500px; display: block;"></alz-chat-widget>@agent-layer-zero/soma β
The shared CSS design system consumed by all three framework libs. You install it as a peer once; it supplies theme tokens, animations, and the BEM stylesheet for every chat component.
npm install @agent-layer-zero/soma// once in your app entry
import '@agent-layer-zero/soma/chat-components.css'Also publishes theme.css, animations.css, base.css, chat.css (markdown prose), components.css (general UI), and all.css (everything in one import), plus a Tailwind preset.
When to use which β
| You're building⦠| Pick |
|---|---|
| Custom chat UI from scratch | dendrite only |
| Vue app | dendrite + dendrite-vue + soma |
| React app | dendrite + dendrite-react + soma |
| Svelte / Solid / Astro / vanilla HTML | dendrite + dendrite-ui + soma |
| Multi-framework site (e.g. Astro with React + Vue islands) | Pick per island β they all read the same soma CSS |
All three framework libs expose the same conceptual surface: create a Neuron, optionally share it across components, render chat UI. The primitives (useNeuron / createNeuronHandle) plug identically into Background Loading & Multi-Neuron.
