> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-24fef6d1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post Button Parameter Reference

> Reference for Post button parameters including text, url, hashtags, via, related accounts, size, language, and DNT for HTML data-* attributes or JavaScript.

A Post button supports pre-populating share text, hashtags, and a X account reference. Associate related X accounts to drive followers.

## Post content parameters

| Parameter | Description | Example |
| - | - | - |
| `text` | Pre-populated text highlighted in the Post composer. | `custom share text` |
| `url` | URL included with the Post. | `https://dev.x.com/web/post-button` |
| `hashtags` | A comma-separated list of hashtags to be appended to default Post text. | `example,demo` |
| `via` | Attribute the source of a Post to a X username. | `xdevelopers` |
| `related` | A comma-separated list of accounts related to the content of the shared URI. | `xapi,x` |

## Button display parameters

Customize your displayed Post Button size, button alignment, and more.

These visual parameters do not apply to Web Intents, which are styled separately by implementing sites.

| Parameter | Description | Example |
| - | - | - |
| `size` | When set to `large`, display a larger version of the button. Set to `l` for iframe. | `large` |
| `lang` | A supported [X language code](/x-for-websites/supported-languages). | `es` |
| `dnt` | When set to `true`, the button and its embedded page on your site are not used for purposes that include [personalized suggestions](https://support.x.com/articles/20169421) and [personalized ads](https://support.x.com/articles/20170405). | `true` |

### HTML `data-*` example

```html theme={null}
<a class="twitter-share-button"
  href="https://x.com/intent/tweet"
  data-size="large"
  data-text="custom share text"
  data-url="https://dev.x.com/web/tweet-button"
  data-hashtags="example,demo"
  data-via="xdevelopers"
  data-related="xapi,x">
Post
</a>
```

### JavaScript factory example

```javascript theme={null}
twttr.widgets.createShareButton(
  "https:\/\/dev.x.com\/web\/tweet-button",
  document.getElementById("tweet-container"),
  {
    size: "large",
    text: "custom share text",
    hashtags: "example,demo",
    via: "xdevelopers",
    related: "xapi,x"
  }
);
```
