Tweet Button Parameter Reference
A Tweet Button supports pre-populating share text, hashtags, and a Twitter account reference. Associate related Twitter accounts to drive followers.
Tweet content parameters
Composer Formatting
When presented in the composer, these parameters will be formatted into an initial message as follows, with the text
portion highlighted:
@{screen_name} {text} {http://url/} #{hashtags} via @{via}
HTML data-* example
<a class="twitter-share-button" href="https://twitter.com/share" data-size="large" data-url="https://dev.twitter.com/web/tweet-button" data-via="twitterdev" data-related="twitterapi,twitter" data-hashtags="example,demo" data-text="custom share text"> Tweet </a>
Iframe example
<iframe src="https://platform.twitter.com/widgets/tweet_button.html?size=l&url=https%3A%2F%2Fdev.twitter.com%2Fweb%2Ftweet-button&via=twitterdev&related=twitterapi%2Ctwitter&text=custom%20share%20text&hashtags=example%2Cdemo" width="140" height="28" title="Twitter Tweet Button" style="border: 0; overflow: hidden;"> </iframe>
JavaScript factory example
twttr.widgets.createShareButton( "https:\/\/dev.twitter.com\/web\/tweet-button", document.getElementById("tweet-container"), { size: "large", via: "twitterdev", related: "twitterapi,twitter", text: "custom share text", hashtags: "example,demo" } );
Web Intent example
<a href="https://twitter.com/share? url=https%3A%2F%2Fdev.twitter.com%2Fweb%2Ftweet-button& via=twitterdev& related=twitterapi%2Ctwitter& hashtags=example%2Cdemo& text=custom%20share%20text"> Tweet </a>