Embedded Moment parameter reference

Customize an embedded Moment with data-* attributes added to a fallback anchor element or passed to a JavaScript factory function in an options object.

Parameters

data-limit

Display a maximum number of items between 1 and 20 inclusive.

Example Value: 3

data-width

Set the maximum width of the embedded moment. Minimum: 220.

Example Value: 400

data-lang

A supported Twitter language code.

Loads template text components in the specified language. Note: does not affect the original text of an author.

Example Value: es

data-dnt

When set to true, the Moment and its embedded page do not influence Twitter targeting including suggested accounts.

Example Value: true

HTML example

<a class="twitter-moment"
  href="https://twitter.com/i/moments/650667182356082688"
  data-limit="3"
  data-width="400">
The Obamas' wedding anniversary
</a>

JavaScript factory example

twttr.widgets.createMoment(
  "650667182356082688",
  document.getElementById("container"),
  {
    width: 400,
    limit: 3
  }
);