Skip to content

harflabs/MarqueeText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarqueeText

A lightweight SwiftUI component that automatically creates marquee scrolling animations when text overflows its container. Perfect for music players, news tickers, status displays, and more.

Features

  • 🎯 Automatic Detection - Only scrolls when text overflows
  • ⚡️ Smooth Animations - Customizable timing and easing
  • 🎨 SwiftUI Native - Built with pure SwiftUI
  • ♿️ Accessible - Full accessibility support
  • ↔️ Localizable - Supports LocalizedStringResource and right to left layouts.
  • 📱 Multi-Platform - iOS, macOS, tvOS, and visionOS

Requirements

  • iOS 16.0+
  • macOS 13.0+
  • tvOS 16.0+
  • visionOS 1.0+

Installation

Swift Package Manager

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/harflabs/MarqueeText.git", from: "1.0.0")
]

Or add it through Xcode:

  1. File → Add Package Dependencies
  2. Enter the repository URL
  3. Select version and add to your target

Usage

Basic Usage

import MarqueeText

MarqueeText("This is a long text that will scroll smoothly across the screen!")

Custom Timing

MarqueeText(
    "Custom timing marquee text",
    duration: 4.0,    // Animation duration
    delay: 0.5,       // Delay before starting
    spacing: 30       // Space between repeated text
)

With Styling

MarqueeText("Styled marquee text")
    .font(.headline)
    .fontWeight(.semibold)
    .foregroundStyle(.primary)
    .padding()
    .background(
        RoundedRectangle(cornerRadius: 12)
          .fill(.ultraThinMaterial)
    )

Examples

Main Showcase

Main Showcase

Music Player Style

Music Player Style

News Ticker Style

News Ticker Style

Short Text (Static)

Short Text (Static)

Custom Timing

Custom Timing

Status Bar Style

Status Bar Style

Social Media Feed

Social Media Feed

Notification Banner

Notification Banner

Loading Screen

Loading Screen

Terminal/Console

Terminal/Console

Apps Using MarqueeText

Add your app here! Submit a pull request to include your app.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About Harf Labs

This library is built by Harf Labs, a software development company that creates solutions for real problems.

If you like this project and need help with your own software projects, we'd love to hear from you! Get in touch and let's build something amazing together.