Embedded Tweet parameter reference¶
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¶
Parameter | Description | Example |
---|---|---|
id | The numerical ID of the desired Tweet. | 20 |
cards | When set to hidden , links in a Tweet are not expanded to photo, video, or link previews. |
hidden |
conversation | When set to none , only the cited Tweet will be displayed even if it is in reply to another Tweet. |
none |
theme | When set to dark , displays Tweet with light text over a dark background. |
dark |
link-color | Adjust the color of Tweet links with a hexadecimal color value. Note: JavaScript factory function uses should use the linkColor parameter. |
#55acee |
width | The maximum width of the rendered Tweet in whole pixels. This value should be between 250 and 550 pixels. | 325 |
align | Float the Tweet left , right , or center relative to its container. Typically set to allow text or other content to wrap around the Tweet. |
right |
lang | A supported Twitter language code. Loads text components in the specified language. Note: does not affect the text of the cited Tweet. | es |
dnt | When set to true , the Tweet and its embedded page do not influence Twitter targeting including suggested accounts. |
true |
HTML example¶
just setting up my twttr
— Jack (@jack) March 21, 2006
<blockquote class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr">just setting up my twttr</p>— Jack (@jack) <a href="https://twitter.com/jack/status/20">March 21, 2006</a>
</blockquote>
JavaScript factory example¶
Note: the numeric Tweet ID should be passed as a string.
twttr.widgets.createTweet(
"20",
document.getElementById("tweet-container"),
{
linkColor: "#55acee"
}
);