> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/custom/view/hline-vline.md).

# HLine / VLine

[swift](/ios/swift.md)⟩ [custom](/ios/custom.md) ⟩ [view](/ios/custom/view.md) ⟩ HLine / VLine

{% hint style="info" %}

{% endhint %}

{% tabs %}
{% tab title="code" %}

```swift
/// ⭐️ horizontal line
struct HLine: View {
    var color: Color = .red
    var width: CGFloat = 1
    var body: some View {
        Rectangle().fill(color).frame(height: width)
    }
}

/// ⭐️ vertical line
struct VLine: View {
    var color: Color = .red
    var width: CGFloat = 1
    var body: some View {
        Rectangle().fill(color).frame(width: width)
    }
}
```

{% endtab %}

{% tab title="👥 相關" %}

{% endtab %}
{% endtabs %}
