New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

splitbun

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

splitbun

A javascript library that splits text element into individual lines, words, or characters.

latest
Source
npmnpm
Version
1.0.17
Version published
Maintainers
2
Created
Source

Splitbun

SplitBun - Text Splitter JavaScript Library

SplitBun is a lightweight JavaScript library that allows you to split text elements into individual lines, words, or characters with ease. This library is perfect for adding animation effects, creating typewriter-like text animations, or any other creative text manipulation you can imagine.

Features

  • Split text into lines, words, or characters.
  • Easily integrate into JavaScript projects.
  • Alternative for GSAP Text Spliter

Installation

NPM/Yarn

To use Text Splitter in your project, you can install it via npm.

npm i splitbun

CDN

Or, include the following

<script src="https://unpkg.com/splitbun"></script>

Usage

To use SplitBun, you need to select the text element you want to split and initialize it. Here's a basic example:

import splitBun from 'splitbun'

splitBun('#target',{
    type: 'lines'
})

API Reference

SplitBun(target, [options])

Target

The target element(s) for the SplitBun call. This can be a selector string or a collection of elements (ie NodeList, jQuery object, or array).

Options

NameTypeDescription
typelines, words, or charsDefault to lines. splits text element into individual lines, words, or characters.
onCompletefunctionFunction that will be executed after text splitting is completed.
wrapperClassstringCustom class for wrapper element
innerClassstringCustom class for inner element
wrapperStylePartial<CSSStyleDeclaration>Custom class for wrapper element
innerStylePartial<CSSStyleDeclaration>Custom class for inner element

Example

Here are a few examples of how you can use SplitBun:

Splitting text into lines

splitBun("[text-split]", {
    type: 'lines',
});

Splitting text into words

splitBun("[text-split]", {
    type: 'words',
});

Splitting text into characters

splitBun("[text-split]", {
    type: 'chars',
});

Using onComplete callback

splitBun("[text-split]", {
    type: 'lines',
    onComplete: () => {
        console.log('split text completed)
    },
});

Using custom class

splitBun("[text-split]", {
    type: 'lines',
    innerClass: 'text-slide-up'
});

Thank you for using SplitBun! We hope you find it helpful for your text animation and manipulation needs. If you have any questions or encounter issues, please don't hesitate to get in touch.

Keywords

typescript

FAQs

Package last updated on 20 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts