DocsGetting started

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/juliya

Apply 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.

tsx
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.

EnvironmentImportMain API
JavaScript / TypeScript@oddmash/juliyawrap, splitLines, segmentSentences
HTML / DOM@oddmash/juliya/dommountJuliya, mountJuliyaScope
React / Next.js@oddmash/juliya/reactJuliyaText, useJuliya, JuliyaProvider
React Server Component@oddmash/juliya/react/serverJuliyaSentenceText
Vue 3@oddmash/juliya/vuejuliyaDirective
Svelte@oddmash/juliya/sveltejuliya

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.

ts
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.