@preflow/prose
v0.1.0
Published
Line-level virtualization for prose content
Downloads
163
Maintainers
Readme
@preflow/prose
Early testing phase — APIs may change before 1.0.
Line-level virtualization for documents whose wrapping can be calculated before paint.
bun add @preflow/proseimport { createProse } from "@preflow/prose";
const prose = createProse({
count: blocks.length,
getLineCount: (index, containerWidth) => measureLines(blocks[index], containerWidth),
lineHeight: 22,
blockGap: 14,
});
prose.setContainerWidth(720);
prose.setViewport(0, 600);
const lines = prose.getLines();ProseFlow maps global line indices to blocks, supports scrollToLine, scrollToEnd, setCount, setContainerWidth, and relayout. createColumnLayout lays out intact blocks across shortest columns; it does not split blocks or perform widow/orphan typography.
React and Vue adapters are exported as useProse from @preflow/react and @preflow/vue.
