JSPM

@getbluma/tiktok-text

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 98
  • Score
    100M100P100Q74313F
  • License MIT

TikTok-style text component with outline effects

Package Exports

  • @getbluma/tiktok-text
  • @getbluma/tiktok-text/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@getbluma/tiktok-text) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@getbluma/tiktok-text

TikTok-style text components with outline effects using SVG rendering.

Installation

npm install @getbluma/tiktok-text
# or
pnpm add @getbluma/tiktok-text

Font Setup

This package includes the TikTok Sans variable font. You need to load it in your project:

// In your project's font loading file
import { continueRender, delayRender, staticFile } from 'remotion';

const waitForFont = delayRender();
const font = new FontFace('TikTok Sans', `url(${staticFile('fonts/TikTok Sans/TikTokSans-Variable.ttf')})`);

font.load().then(() => {
  document.fonts.add(font);
  continueRender(waitForFont);
});

Copy the font from node_modules/@getbluma/tiktok-text/fonts/ to your public folder.

Components

TikTokText

Simple text without outline.

import { TikTokText } from '@getbluma/tiktok-text';

<TikTokText>Hello World</TikTokText>
<TikTokText size="xl" weight="bold">Big Bold Text</TikTokText>

TikTokTextOutline

Text with SVG stroke outline (TikTok caption style).

import { TikTokTextOutline } from '@getbluma/tiktok-text';

// Basic usage (white text, black outline)
<TikTokTextOutline>Hello World</TikTokTextOutline>

// Custom colors
<TikTokTextOutline color="#FFFF00" outlineColor="#FF0000">
  Yellow with Red Outline
</TikTokTextOutline>

// With gradient fill
<TikTokTextOutline
  gradient={{
    type: 'linear',
    angle: 90,
    stops: [
      { offset: '0%', color: '#FF0000' },
      { offset: '100%', color: '#FFFF00' }
    ]
  }}
>
  Gradient Text
</TikTokTextOutline>

TikTokTextBlock

Text with gooey/rounded background effect (perfect for multi-line captions).

import { TikTokTextBlock } from '@getbluma/tiktok-text';

// Basic usage (purple background, white text)
<TikTokTextBlock>Hello World</TikTokTextBlock>

// With preset color
<TikTokTextBlock backgroundColor="red">Warning Message</TikTokTextBlock>
<TikTokTextBlock backgroundColor="blue" size="xl">Blue Background</TikTokTextBlock>

// Step indicator style (white bg, black text)
<TikTokTextBlock backgroundColor="white" color="#000000">
  1. first step title
</TikTokTextBlock>

// Multi-line text with gooey wrap effect
<TikTokTextBlock backgroundColor="purple" size="m">
  this is a longer piece of text that will
  wrap across multiple lines with smooth
  rounded corners on each line
</TikTokTextBlock>

// Using custom hex color
<TikTokTextBlock backgroundColor="#FF69B4">Custom Pink</TikTokTextBlock>

Props

Common Props (both components)

Prop Type Default Description
children ReactNode required Text content
size TextSize | number 'l' (64px) Size preset or custom pixels
weight FontWeight | number 'medium' (500) Weight preset or custom 100-900
color string #000000 / #FFFFFF Text color
style CSSProperties {} Additional CSS styles
className string '' CSS class name

Size Presets

Preset Pixels
xs 24px
s 32px
m 48px
l 64px
xl 84px
xxl 96px
xxxl 128px

Weight Presets

Preset Value
light 300
regular 400
medium 500
semibold 600
bold 700
extrabold 800
black 900

TikTokTextOutline Additional Props

Prop Type Default Description
outlineColor string #000000 Stroke color
align 'left' | 'center' | 'right' 'center' Text alignment
maxCharsPerLine number - Text wrapping threshold
lineHeight number 1.4 Line height multiplier
letterSpacing number 0 Letter spacing in pixels
wordSpacing number 0 Word spacing in pixels
strokeWidth number auto Explicit stroke width
strokeRatio number 0.16 Stroke ratio relative to font size
italic boolean false Italic style
opacity number 1 Global opacity (0-1)
fillOpacity number - Fill-only opacity
strokeOpacity number - Stroke-only opacity
textDecoration TextDecoration 'none' underline, overline, line-through
textTransform TextTransform 'none' uppercase, lowercase, capitalize
rotate number 0 Rotation in degrees
skewX number 0 Horizontal skew in degrees
skewY number 0 Vertical skew in degrees
scaleX number 1 Horizontal scale
scaleY number 1 Vertical scale
dx number 0 Horizontal offset
dy number 0 Vertical offset
shadow TextShadow - Drop shadow config
gradient TextGradient - Gradient fill config
svgWidth number 1000 SVG viewBox width

TikTokTextBlock Additional Props

Prop Type Default Description
backgroundColor TextBlockColor | string 'purple' Background color (preset name or hex)
align 'left' | 'center' | 'right' 'center' Text alignment
textTransform TextTransform 'lowercase' Text transform
lineHeight number 1.5 Line height multiplier
letterSpacing number -1 Letter spacing in pixels
paddingX number 0.5 Horizontal padding in em units
paddingTop number 6 Top padding in pixels
paddingBottom number 10 Bottom padding in pixels
blurRadius number 8 Blur radius for gooey effect
filterId string auto Custom SVG filter ID

Background Color Presets

Name Hex
white #FFFFFF
black #000000
red #D94C4C
orange #E87D3E
yellow #D4B93C
green #5AAE5A
teal #4A9E8E
cyan #4ABDBD
lightBlue #5AAFDB
blue #3D7FCC
darkBlue #2B5A9E
purple #7B5CF5
magenta #B94FD4
dustyRose #C48A9F
brown #5C4033
rust #A65D3F
olive #8B8B5E
darkGreen #3D5A3D
darkTeal #2E5B6E
navy #2B3A52
aqua #7DD4D4
periwinkle #9494E0
skyBlue #A8D4F0
lavender #E8C8E8
peach #F0B8B8
paleYellow #F8F0A0
gray #B8B8B8
darkGray #4A4A4A

Shadow Config

shadow={{
  offsetX: 4,
  offsetY: 4,
  blur: 8,
  color: 'rgba(0,0,0,0.5)'
}}

Gradient Config

gradient={{
  type: 'linear', // or 'radial'
  angle: 90,      // for linear gradients
  stops: [
    { offset: '0%', color: '#FF0000' },
    { offset: '100%', color: '#FFFF00' }
  ]
}}

Utilities

wrapText

Helper function to wrap text by character count.

import { wrapText } from '@getbluma/tiktok-text';

const lines = wrapText('Long text that needs wrapping', 20);
// Returns: ['Long text that needs', 'wrapping']

License

MIT

TikTok Sans font is licensed under SIL Open Font License.