---
description: 進度條的「標題部分」。
---

# NeuProgressBarTitle 📦

![進度條的「標題部分」](https://1830103165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-JmwCZMKh_d7RfBaN%2F-MI9XVJDncDwMN8KQnog%2F-MI9Y2hgEg6Eg1Tw9ODs%2Fprogress%20bar%20title.jpg?alt=media\&token=27b875f5-0ee1-439c-a267-00a6b74df4a2)

{% tabs %}
{% tab title=" NeuProgressBarTitle 📦" %}
```swift
import SwiftUI

// ⭐️ `NeuProgressBar2` 的「標題」部分
public struct NeuProgressBarTitle: View {
    
    var            title: String
    @Binding var percent: CGFloat
    
    public init(title: String, percent: Binding<CGFloat>) {
        self._percent = percent  // ⭐️ 傳進 @Binding 變數的方式
        self.title    = title
    }
    
    public var body: some View {
        HStack {
            
            // title
            Text(self.title)
                .foregroundColor(Neu.color.text)
                .bold()
            
            Spacer()
                
            // percentage
            Text("\(Int(self.percent * 100))%")
                .foregroundColor(Neu.color.text)
                .bold()
        }
    }
}
```
{% endtab %}

{% tab title="相依套件" %}
* [Neu 🔸](../gradients/neu)
{% endtab %}
{% endtabs %}
