Giter Site home page Giter Site logo

mojtabahs / swiftui-shimmer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markiv/swiftui-shimmer

1.0 1.0 2.0 145 KB

Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS and watchOS.

License: MIT License

Swift 100.00%

swiftui-shimmer's Introduction

SwiftUI-Shimmer ✨

Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS and watchOS.

import SwiftUI
import Shimmer
:
:
Text("SwiftUI Shimmer").modifier(Shimmer())

or more conveniently

Text("SwiftUI Shimmer").shimmering()

Light Mode Dark Mode

Optional Parameters ⚙️

  • active: Convenience parameter to conditionally enable the effect. Defaults to true.
  • duration: The duration of a shimmer cycle in seconds. Default: 1.5.
  • bounce: Whether to bounce (reverse) the animation back and forth. Defaults to false.

Bounce 3

Animated Skeletons ☠️

Of course, you can combine .shimmering(...) with the .redacted(...) modifier to create interesting animated skeleton views.

Loading

Text("Some text")
    .redacted(reason: .placeholder)
    .shimmering()

Installation

SwiftUI-Shimmer can be installed using Swift Package Manager.

Use the package URL to search for the URLImage package: https://github.com/markiv/SwiftUI-Shimmer.

For how-to integrate package dependencies refer to Adding Package Dependencies to Your App documentation.

What About UIKit?

For an older, UIKit-based shimmer effect, see UIView-Shimmer.

swiftui-shimmer's People

Contributors

markiv avatar mojtabahs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.