nuxt-x-affiliate
Reading Time
{n} min read
Reading Time
The XAFReadingTime component renders the "{n} min read" badge — pass either a word count, the article content (HTML or plain text), and the component computes the minutes at the configured WPM (default 200).
Components
<XAFReadingTime />
<XAFReadingTime :words="1850" />
<XAFReadingTime :content="articleBody" />
<XAFReadingTime :content="articleBody" :wpm="220" variant="inline" />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
words | number | — | Pre-computed word count. |
content | string | — | Article body. Words are computed by stripping HTML tags and counting whitespace-split tokens. |
wpm | number | 200 | Reading speed (words per minute). |
showSuffix | boolean | true | Show " read" suffix (e.g. "8 mins read" vs "8 mins"). |
variant | 'pill' | 'inline' | 'pill' | Visual variant. |
At least one of words or content must be provided. The minimum is always 1 minute.
AI Context
component: XAFReadingTime
package: "@xenterprises/nuxt-x-affiliate"
use-when: "N min read" badge auto-computed from words or content, configurable WPM, pill or inline variant.
