Skip to content

Commit

Permalink
Merge pull request #28 from dandv/patch-2
Browse files Browse the repository at this point in the history
Document the placeholder prop
  • Loading branch information
capaj committed Mar 28, 2023
2 parents 469c282 + 67fb158 commit b76b16d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ export const App = () => {
}
```

You don't have to put `//platform.twitter.com/widgets.js` script in your index.html as this lib will put it there if `twttr` is not found on window.
You don't have to put `//platform.twitter.com/widgets.js` script in your index.html as this lib will put it there if `twttr` is not found on `window`.

## Using Options
## Props

```tsx
<TweetEmbed tweetId='783943172057694208' options={{cards: 'hidden' }}/>
<TweetEmbed tweetId='771763270273294336' options={{theme: 'dark' }}/>
### `placeholder`

Text to be shown while the tweet is loading:
```html
<TweetEmbed id='1186523464712146944' placeholder='Sending this tweet through space via Starlink satellite 🛰'/>
```

Embedded-Tweet Options Reference:
https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference
### `options`

Key-value pairs from the [embedded tweet parameter reference](https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference):

```html
<TweetEmbed id='783943172057694208' options={{cards: 'hidden' }}/>
<TweetEmbed id='771763270273294336' options={{theme: 'dark' }}/>

```

0 comments on commit b76b16d

Please sign in to comment.