0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Placeholder text via data attributes. Fill any element with lorem ipsum, specify word counts, sentence counts, or list items. Auto-detects language for Japanese, Chinese, Korean, Arabic, Hebrew and Cyrillic corpuses.
Overview
The data-loremattribute fills any text-containing element with placeholder text. Built-in corpuses for Latin, Japanese, Chinese, Korean, Arabic, Hebrew and Cyrillic keep the browser bundle lean (~6KB) without requiring external dependencies.
Default paragraph
1
<pdata-lorem></p>
How It Works
On DOMContentLoaded, finds all elements with data-lorem
Parses the attribute value to determine word count, sentence count, or mode
Detects the appropriate corpus from the element's langattribute (or its ancestors)
Fills the element's textContent (or innerHTML for list items)
Marks the element with data-lorem-filled and translate="no"
A MutationObserver watches for dynamically added elements
Set automatically after content is injected. Used as CSS hook for wireframe integration.
data-lorem-init
boolean
Set automatically to prevent double-binding. Do not set manually.
Values
Value
Result
Example
(empty)
~50 words of lorem ipsum
<p data-lorem></p>
50
50 words
<p data-lorem="50"></p>
3 sentences
3 full sentences
<p data-lorem="3 sentences"></p>
heading
5 words (heading-length)
<h2 data-lorem="heading"></h2>
5 items
5 <li> elements (on <ul>/<ol>)
<ul data-lorem="5 items"></ul>
cjk
Japanese placeholder corpus (~80 characters)
<p data-lorem="cjk"></p>
chinese
Chinese (Simplified) placeholder corpus (~80 characters)
<p data-lorem="chinese"></p>
korean
Korean placeholder corpus
<p data-lorem="korean"></p>
arabic
Arabic placeholder corpus
<p data-lorem="arabic"></p>
hebrew
Hebrew placeholder corpus
<p data-lorem="hebrew"></p>
cyrillic
Cyrillic placeholder corpus
<p data-lorem="cyrillic"></p>
Word Count
Pass a number to get that many words.
Word count
1
<pdata-lorem="20"></p>
Sentence Count
Use N sentences for full sentences (singular sentence also works).
Sentence count
1
<pdata-lorem="3 sentences"></p>
Headings
Use heading for short, heading-length text (5 words).
Heading text
1
<h2data-lorem="heading">Generated heading</h2>
List Items
On <ul> or <ol>, use N items to generate <li> elements.
List items
1
<uldata-lorem="5 items"></ul>
Multi-language Support
The corpus auto-detects from the langattribute on the element or any ancestor. You can also force a specific corpus by name.
Language detection
Language codes
Corpus
ja
Japanese (cjk), counted in characters
zh
Chinese, Simplified (chinese), counted in characters
ko
Korean (korean), counted in words
ar, fa, ur
Arabic (arabic)
he
Hebrew (hebrew)
ru, uk, bg, sr
Cyrillic
any other / none
Latin (default)
Multi-language corpuses
123456789101112
<!-- Auto-detected from lang attribute --><plang="ja"data-lorem></p><plang="ar"data-loremdir="rtl"></p><plang="ru"data-lorem></p><!-- Explicit corpus override --><pdata-lorem="cjk"></p><pdata-lorem="chinese"></p><pdata-lorem="korean"></p><pdata-lorem="arabic"></p><pdata-lorem="hebrew"dir="rtl"></p><pdata-lorem="cyrillic"></p>
Production Transition
Replace the content and remove data-lorem. No structural changes needed.
Prototype to production
12345
<!-- Prototype --><pdata-lorem="3 sentences"></p><!-- Production: replace content, remove data-lorem --><p>Our platform helps teams ship faster with modern tooling.</p>
Wireframe Integration
In data-wireframe="lo" mode, elements with data-lorem-filled get abstract text-block styling: extra letter-spacing and reduced opacity.
Lo-fi wireframe appearance
1234567
<!-- In lo-fidelity wireframe, lorem text gets abstract appearance --><htmldata-wireframe="lo"><body><pdata-lorem></p><!-- Text renders with extra letter-spacing and reduced opacity --></body></html>
Dynamic Elements
Elements added to the DOM after page load are automatically filled via a MutationObserver.
Dynamic lorem elements
12345
// Dynamically added elements are auto-enhanced via MutationObserverconst p = document.createElement('p');p.dataset.lorem = '3 sentences';document.body.appendChild(p);// p is filled with lorem text automatically
Accessibility
Sets translate="no" on filled elements so translation tools skip placeholder text
Does not set aria-hidden — screen readers should still read placeholder content during testing to verify document structure