This component no longer exists. It was in remotionui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-11 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
text-fit-utils
remotionui/text-fit-utilsRemovedUtility
Safe headline fitting helpers
Install it
npx shadcn@latest add https://remotionui.com/r/text-fit-utils.jsonSource
1export type FitHeadlineOptions = {2 text: string;3 maxWidth: number;4 maxFontSize: number;5 minFontSize?: number;6 fontFamily?: string;7 fontWeight?: string | number;8 fallbackWidth?: number;9};1011export function fitHeadline({12 text,13 maxWidth,14 maxFontSize,15 minFontSize = 32,16}: FitHeadlineOptions): number {17 const longestLine = text18 .split(/\s+/)19 .reduce((longest, word) => Math.max(longest, word.length), 1);20 const estimatedCharacters = Math.max(longestLine, text.length * 0.56);21 const estimatedSize = maxWidth / Math.max(1, estimatedCharacters * 0.56);2223 return Math.round(Math.max(minFontSize, Math.min(maxFontSize, estimatedSize)));24}
