TikTok
A TikTok video in the official player.
import { TikTok } from 'sveltekit-embed'; 1<TikTok tiktok_id="6718335390845095173" loop music_info description />tiktok_id is the number at the end of the video’s URL, after /video/.
A bare player
Every part of the player’s interface has its own prop. This leaves only the video and a play button.
1<TikTok
2 tiktok_id="6718335390845095173"
3 progress_bar={false}
4 volume_control={false}
5 fullscreen_button={false}
6 timestamp={false}
7 rel={false}
8/>Props
| Prop | Type | Default |
|---|---|---|
tiktok_id required The number at the end of the video’s URL. | string | – |
width Any CSS width. | string | '100%' |
height Any CSS height. | string | '600px' |
controls Show the player controls. | boolean | true |
progress_bar Show the progress bar. | boolean | true |
play_button Show the play button. | boolean | true |
volume_control Show the volume control. | boolean | true |
fullscreen_button Show the fullscreen button. | boolean | true |
timestamp Show the current time and duration. | boolean | true |
loop Start again when the video ends. | boolean | false |
autoplay Start playing as soon as it loads. | boolean | false |
music_info Show the sound used in the video. | boolean | false |
description Show the video’s caption. | boolean | false |
rel Show related videos at the end. | boolean | true |
native_context_menu Keep TikTok’s right-click menu. | boolean | true |
closed_caption Show closed captions when there are any. | boolean | true |
loading
| 'lazy' | 'eager' | 'lazy' |
Something wrong on this page? Edit it on GitHub.