Svelte
Use the action on an element. Reactive options update the measured wrapping; removing the element cleans up the controller.
Basic action
Attach the juliya action with options to an element that has a measurable width.
svelte
<script>
import { juliya } from '@oddmash/juliya/svelte';
let text = "Read every line naturally.";
</script>
<p use:juliya={{ text, locale: 'en' }}></p>Language selection
Pass the locale explicitly for multilingual apps; omitted locale is Korean.
Required options
Pass text or inline: true, not both.
| Option | Required | Default | Purpose |
|---|---|---|---|
text | Conditional | - | Source for string mode; omit in inline mode |
inline | Conditional | false | Set true for existing inline markup |
locale | Optional | ko | Language rules; React also reads the nearest Provider |
strategy | Optional | balanced | Balanced or greedy layout |
breakLongWords | Optional | true | Allow grapheme-safe splits for overlong words |
forcedBreaks | Optional | - | Source UTF-16 boundary offsets |
Inline markup
For trusted externally rendered HTML use juliyaScope; do not mutate Svelte-owned dynamic text from both paths.
svelte
<p use:juliya={{ inline: true }}><strong>Read every line naturally.</strong></p>State changes and forced boundaries
Reactive action parameters call update; removal calls destroy. Keep forced UTF-16 offsets in sync with the text.
SvelteKit and SSR
Render consistent server content first and enhance after browser hydration.