The default, highlighted text a user sees in the Tweet web intentĪ list of hashtags to be appended to default Tweet text where appropriate.Īll the parameters described above for all widgets and for embedded Tweets apply also to embedded timelines. The alignment of the button within an iframe use this to ensure flush layout when aligning buttons Locale dependent ( left or right, depending on the text direction of the language.) When set to true, the embed and its embedded page on your site are not used for purposes that include personalized suggestions and personalized adsĪny comma-separated list of valid Twitter screen names.Ī list of Twitter screen names to be suggested for following after a Tweet or Tweet action is posted.Ī Twitter user mentioned in the default Tweet text as appropriate.Īdditional configuration options for button widgets Option The language in which to render a widget, if supported (see the Translation Center.) You can execute code after a widget has been created by passing a callback to:Īdditional configuration and options can be passed to the factory functions, as in the above examples.Īdditional configuration for all widgets Option If you need to delay the display of a widget, use CSS to position the widget off-screen until needed.Įvery create function returns a Promise. Use the target argument to render widgets into their final location in a page. For buttons this can waste bandwidth, while for Tweets and timelines this will cause dynamically injected content to be lost. When an iframe is moved within the DOM the browser will reload its content. Note that widgets usually render as iframe elements. An object hash of additional options to configure the widget. The element in which to render the widget.
hashtag: Hashtag to be Tweeted and displayed on the button.screen_name: The screen_name of a user to be followed, or mentioned.The first argument is required, and is unique to the button type. A set of factory functions can generate any widget type:ĬreateShareButton, createFollowButton, createHashtagButton, and createMentionButton take similar arguments. Widgets can be generated at runtime, without requiring an HTML embed code. In addition, there are a number of functions of widgets-js that allow you to work with Twitter content dynamically: Creating widgets at runtime with factory functions (See the Twitter for Websites set-up documentation for a recommended code snippet.)īy default, widgets-js will find mark-up in a page and convert basic, functional mark-up into rich interactive widgets. When adding a Twitter widget to your page, this JavaScript file is included in the HTML embed code, or you can directly include in your page. Twitter for Websites products-Tweet buttons, Follow buttons, embedded Tweets and timelines-are all loaded using a JavaScript utility named widgets-js. If you’re integrating your site with Twitter using Twitter for Websites and Web Intents, you can dynamically generate widgets using JavaScript functions.