@inkset/react
v0.1.7
Published
React bindings for Inkset, including the Inkset component and useInkset hook.
Downloads
926
Maintainers
Readme
@inkset/react
React bindings for Inkset, including the Inkset component and useInkset() hook.
Install
npm install @inkset/react @inkset/coreUsage
import { Inkset } from "@inkset/react";
import { createCodePlugin } from "@inkset/code";
import { createMathPlugin } from "@inkset/math";
const plugins = [createCodePlugin(), createMathPlugin()];
export const ChatMessage = ({ content, streaming }: { content: string; streaming: boolean }) => {
return <Inkset content={content} streaming={streaming} plugins={plugins} />;
};Most apps should start with <Inkset>. useInkset() is the lower-level hook for custom renderers, imperative stream control, and direct access to pipeline state.
Also exported
useInkset— the underlying hook (plusUseInksetOptions/UseInksetResult)InksetProps— prop types for<Inkset>themeToCssVars— compile anInksetThemeobject into--inkset-*CSS variables (plusInksetTheme,HeadingTuple,InksetCssVars)createShaderRegistry,defaultShaderRegistry— re-exported from@inkset/animatefor custom reveal shaders- Reveal config types re-exported from
@inkset/animate:RevealProp,ThrottleOptions,TimelineOptions,CssRevealOptions,ShaderConfig,ShaderRegistry, etc.
See the repo root README for a fuller overview of the layout model and plugin system.
