JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Twitter Share Button

The Twitter Share Button web component provides a simple and customizable interface for sharing URLs directly to Twitter.

  • Automatically uses the URL, title and description of the page when present
  • Allows you to override the URL and text to share to Twitter.
  • Allows you to configure the display with your own text and icons.
  • When combined with <share-button> element, it will automatically bind to the data from it's host component and be embedded in the share control.

Published on


Customize the UI

<twitter-share-button>Twitter Button</twitter-share-button>

Add an image

<twitter-share-button href=""><img src=""></twitter-share-button>

Customize the URL to share

<twitter-share-button href=""></twitter-share-button>

Customize the text to share

<twitter-share-button text="Testing attribute">Attribute Text Test</twitter-share-button>

The full 9 yards

<twitter-share-button href="" text="Testing URL attribute">Attribute and URL Test</twitter-share-button>