Skip to content

Conversation

@KavanBhavsar35
Copy link
Contributor

Summary

Fixes #676
This PR refines the TrueFocus component by replacing the previously proposed words prop idea with an optional separator parameter.
The new separator prop (default: " ") lets developers control how the sentence string is split into words, enabling flexible customization of text segmentation.


Changes

  • Added optional prop:

    separator?: string // default: " "
  • Words are now derived via sentence.split(separator) instead of being fixed to spaces.

  • Removed the previously proposed words prop (discarded).

  • Updated logic and typings to reflect this behavior.

  • Maintains full backward compatibility — existing usage remains unchanged.


Motivation

Previously, words were always split by a single space, which limited flexibility for custom delimiters or multi-word tokens.
The new separator option allows developers to use any string as a delimiter, such as:

<TrueFocus sentence="One|Two|Three" separator="|" />

@DavidHDev
Copy link
Owner

Great! Thanks!

@DavidHDev DavidHDev merged commit 650353c into DavidHDev:main Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: text-animations/true-focus

2 participants