Getting started
Install Juliya, select a language, and wrap text using actual layout measurements. Korean remains the default when locale is omitted.
Installation
Install one package with the package manager you use. Node.js 20 or newer and modern browsers with Intl.Segmenter are supported. React requires 18.2 or newer.
npm install @oddmash/juliyapnpm add @oddmash/juliyayarn add @oddmash/juliyaApply in one minute
Replace a text heading with JuliyaText. It measures the element's content width and font and recalculates when either changes. Use JuliyaProvider to configure a language for descendants.
import { JuliyaProvider, JuliyaText } from '@oddmash/juliya/react';
<JuliyaProvider locale="en">
<JuliyaText as="h1">Read every line naturally.</JuliyaText>
</JuliyaProvider>Choose an entry point
Use the core engine for measured strings and the adapter for your framework when the DOM should be measured automatically.
| Environment | Import | Main API |
|---|---|---|
| JavaScript / TypeScript | @oddmash/juliya | wrap, splitLines, segmentSentences |
| HTML / DOM | @oddmash/juliya/dom | mountJuliya, mountJuliyaScope |
| React / Next.js | @oddmash/juliya/react | JuliyaText, useJuliya, JuliyaProvider |
| React Server Component | @oddmash/juliya/react/server | JuliyaSentenceText |
| Vue 3 | @oddmash/juliya/vue | juliyaDirective |
| Svelte | @oddmash/juliya/svelte | juliya |
Choose an integration
For existing HTML use mountJuliyaScope on an explicit root; ordinary React JSX uses JuliyaText. For custom rendering use wrap or observeJuliya. See project configuration and scoped DOM.
First JavaScript example
This example counts Unicode code points instead of pixels; pass a measurement in matching units for real layouts.
import { wrap } from '@oddmash/juliya/en';
const lines = wrap("Read every line naturally.", {
width: 12,
measure: text => [...text].length,
});Next steps
Read the core engine, forced breaks, React, Vue, Svelte or SSR for your use case.