Skip to content
sveltekit-embed
Video

TikTok

A TikTok video in the official player.

import { TikTok } from 'sveltekit-embed';
Svelte
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.

Svelte
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

PropTypeDefault
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.

booleantrue
progress_bar

Show the progress bar.

booleantrue
play_button

Show the play button.

booleantrue
volume_control

Show the volume control.

booleantrue
fullscreen_button

Show the fullscreen button.

booleantrue
timestamp

Show the current time and duration.

booleantrue
loop

Start again when the video ends.

booleanfalse
autoplay

Start playing as soon as it loads.

booleanfalse
music_info

Show the sound used in the video.

booleanfalse
description

Show the video’s caption.

booleanfalse
rel

Show related videos at the end.

booleantrue
native_context_menu

Keep TikTok’s right-click menu.

booleantrue
closed_caption

Show closed captions when there are any.

booleantrue
loading

lazy waits until the embed is near the viewport, eager loads it straight away.

'lazy' | 'eager''lazy'

Something wrong on this page? Edit it on GitHub.