Embedded Tweet parameter reference

Updated on Fri, 2014-08-15 17:26

An Embedded Tweet supports customization in data-* attributes and JavaScript factory functions. This reference document describes parameters used in all formats.

Reference the oEmbed API to set these parameters as part of an HTML response for a Tweet ID or URL.

Parameters

id required

The numerical ID of the desired Tweet.

Example Values: 20

cards optional

When set to hidden, links in a Tweet are not expanded to photo, video, or link previews.

Example Value: hidden

conversation optional

When set to none, only the cited Tweet will be displayed even if it is in reply to another Tweet.

Example Value: none

theme optional

When set to dark, displays Tweet with light text over a dark background.

Example Value: dark

width optional

The maximum width of the rendered Tweet in whole pixels. This value should be between 250 and 550 pixels.

Example Value: 325

align optional

Float the Tweet left, right, or center relative to its container. Typically set to allow text or other content to wrap around the Tweet.

Example Value: right

HTML example

  1. <blockquote class="twitter-tweet" data-link-color="#55acee" lang="en">
  2. <p>just setting up my twttr</p>
  3. &mdash; Jack Dorsey (@jack)
  4. <a href="https://twitter.com/jack/status/20">March 21, 2006</a>
  5. </blockquote>

JavaScript factory example

Note: the numeric Tweet ID should be passed as a string.

  1. twttr.widgets.createTweet(
  2.   "20",
  3.   document.getElementById("tweet-container"),
  4.   {
  5.     linkColor: "#55acee"
  6.   }
  7. );