> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swiftcn.lol/llms.txt
> Use this file to discover all available pages before exploring further.

# Shimmerbutton

# ShimmerButton Component in SwiftUI

## Overview

`ShimmerButton` is a SwiftUI component designed for creating buttons with a shimmering animation. It features customizable text size, background and text colors, border radius, and shimmer duration, offering flexibility for various use-cases.

## Preview

<div style={{ display: "flex", justifyContent: "center" }}>
  <div>
    <img src="https://www.swiftcn.lol/shimmerButton.gif" width="300" />
  </div>
</div>

## Installation

Include the `ShimmerButton.swift` file in your SwiftUI project. [File Link](https://github.com/Swiftcn-UI/swiftcn-playground/blob/main/Swiftcn%20Playground.swiftpm/Components/ShimmerButton.swift)

## Properties

### Required Properties

* `text: String` - The text displayed on the button.

### Optional Properties

* `textSize: CGFloat` - The size of the text displayed. Default is `20.0`.
* `shimmerDuration: Double` - The duration of the shimmer animation. Default is `3.0`.
* `borderRadius: CGFloat` - The radius of the button's corners. Default is `30`.
* `backgroundColor: Color` - The background color of the button. Default is `.black`.
* `textColor: Color` - The color of the text. Default is `.white`.

## Usage

### Basic Usage

Here's how you can use the `ShimmerButton` component:

```swift theme={null}
ShimmerButton(text: "Submit")
```

### Custom Usage

Here's how you can customize the `ShimmerButton` component:

```swift theme={null}
ShimmerButton(
    text: "Submit",
    textSize: 30,
    shimmerDuration: 2.0,
    borderRadius: 20,
    backgroundColor: .black,
    textColor: .white
)
```
