X Enterprises
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

PropTypeDefaultDescription
wordsnumberPre-computed word count.
contentstringArticle body. Words are computed by stripping HTML tags and counting whitespace-split tokens.
wpmnumber200Reading speed (words per minute).
showSuffixbooleantrueShow " 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.
Copyright © 2026