TikTok

A React TikTok UI component - the web player, its photo carousel and the mobile viewport. For clones and mockups.

TikTok playground

Shariatpur

ABRAR ISLAM SAIFUL

Golden hour on the coast road, second stop of the day. The whole set is in the carousel and I still cannot pick a favourite

  • 3149
  • 201
  • 480
  • 789
The 1584px web player, scaled down to fit this column - open it at full size for the real metrics. Drag the carousel, page with the chevrons or the arrow keys.

Install TikTok

1. New project? One command installs the package and wires everything - see Installation:

bash
pnpm dlx zyncat-ui init

2. Import the component - it loads its own stylesheet:

tsx
import { TikTok } from '@zyncat/ui/tiktok';

Usage

tsx
import { TikTok } from '@zyncat/ui/tiktok';
 
<TikTok surface="desktop" name="zyncat.studio" caption="Build log 04" media={clip} likes={187000} />

Compose TikTok in your application. No Tailwind or external styling library is required; every value resolves from Zyncat UI's token vocabulary.

TikTok props

TikTok

PropTypeDefaultDescription
...htmlAttributesHTMLAttributes—Standard element attributes (aria-*, data-*, id, ...) forwarded to the root.
surfaceTikTokSurface—Which platform surface to reproduce. Desktop is the 1584x912 web player with the photo carousel; mobile is the 452x822 mobile-web viewport.
ratioTikTokRatio—Aspect ratio of the media inside the frame. Defaults to 3:2 on desktop and 4:3 on mobile.
namestring—Creator name shown over the media.
captionstring—Post caption. Ellipsised to one line on desktop and two on mobile until "more" is pressed.
locationstring—Desktop only. Place name in the pin chip above the creator name.
musicstring—Mobile only. Music attribution shown first on the sound line.
soundstring—Mobile only. Sound title shown after the music attribution.
likesnumber—Like count. Printed exactly below 10,000, then abbreviated as the platform does.
commentsnumber—Comment count.
savesnumber—Desktop only. Save count - the mobile rail has no save action.
sharesnumber—Share count.
mediaReactNode—Post media: a URL string rendered as a decorative image, or a node you render yourself. On desktop an array supplies one entry per carousel slide.
avatarReactNode—Creator avatar: a URL string, or a node you render yourself.
stickerReactNode—Sound artwork on the disc at the foot of the rail: a URL string, or a node you render yourself.
slidesnumber—Desktop only. Number of carousel slides. Raised to the length of `media` when that is an array.
slidenumber—Desktop only. Controlled 1-based carousel position.
defaultSlidenumber—Desktop only. Uncontrolled starting carousel position.
onSlideChange(slide: number) => void—Desktop only. Fires with the new 1-based position when the carousel pages.
mutedboolean—Desktop only. Controlled state of the mute control. The component never plays or pauses media - wire this to your own player.
defaultMutedboolean—Desktop only. Uncontrolled starting state of the mute control.
onMutedChange(muted: boolean) => void—Desktop only. Fires when the mute control is pressed.
translationboolean—Desktop only. Renders the platform's "See translation" line under the frame.
likedboolean—Controlled like state. The displayed like count adds one while this is on.
defaultLikedbooleanfalseUncontrolled initial like state.
onLikedChange(liked: boolean) => void—Fires when the heart toggles the like.
savedboolean—Desktop only. Controlled save state for the bookmark on the rail.
defaultSavedbooleanfalseUncontrolled initial save state.
onSavedChange(saved: boolean) => void—Fires when the bookmark toggles.
followedboolean—Controlled follow state for the plus badge on the creator avatar.
defaultFollowedbooleanfalseUncontrolled initial follow state.
onFollowedChange(followed: boolean) => void—Fires when the follow badge toggles.
onAction(action: TikTokAction) => void—Fires for the actions that carry no state: comment, share, menu, search.
classNamestring—Extra class(es) merged onto the root.
styleCSSProperties—Inline styles merged onto the root.

Frequently asked questions

Import it and pick a surface: <TikTok surface="desktop" ratio="3:2" name="Lena" location="Shariatpur" caption="Golden hour on the coast road" media={[shotA, shotB]} likes={3149} comments={201} saves={480} shares={789} />. surface takes desktop or mobile, ratio letterboxes the media at 3:2, 4:3, 1:1, 16:9, 9:16 or 3:4, and every value on screen is a prop. It is the TikTok UI only, so the data layer, the routing and the auth in your TikTok clone project stay yours.

No to both. There is no TikTok API call, no login, no network request and no real videos anywhere in it - the component is the TikTok user interface, not an embed. media, avatar and sticker take a URL string or your own node, so a <video>, an <img> or a next/image element renders exactly what you pass. Nothing autoplays either: muted toggles the speaker glyph and reports through onMutedChange, and you wire that to your own player.

Two surfaces behind one prop. desktop is the 1584x912 web player - the pin chip, creator name, one-line caption with "more", the blurred saturated letterbox behind the frame, the mute chip and the "See translation" line that translation controls. mobile is the 452x822 mobile-web viewport with the menu and search buttons, a two-line caption and the music + sound line. liked and followed toggle on both surfaces while saved and muted are desktop only, each with a default and an onChange prop, and onAction fires for comment, share, menu and search. Counts print exact below 10,000 and then abbreviate to 184.2K or 1.4M.

None of the three. Searching "tiktok ui", "tiktok mockup" or "tiktok ui overlay" returns Figma community files, PSDs and transparent PNGs you cannot ship, and a PNG cannot be tabbed into. This is a working React component in plain CSS and semantic HTML, so the heart, bookmark, follow badge and mute chip are real buttons with aria-label and aria-pressed. As a TikTok mockup generator it beats a screenshot because it redraws live at the platform's own pixel metrics and never ages; those metrics are pinned constants with no --tiktok-* knob, and no wordmark or logo ships with it.

Yes. @zyncat/ui/tiktok ships compiled ESM with its 'use client' directive intact, so it drops into the Next.js App Router on React 19 with no transpilePackages config and zero runtime dependencies; link @zyncat/ui/styles.css once at the root for the motion tokens. The post markup is in the server-rendered HTML, which is the difference between this and embedding a TikTok video in HTML - an oEmbed iframe fetches from TikTok at runtime and you cannot restyle it.

Set in Geist & Newsreader — animated by the house engineZyncat UI · Rev 0.11 · MIT · Built by Tabsir Ahammed · Source on GitHub