https://github.com/nuplay/linkpreview
Preview with Link's meta information.(SwiftUI)
https://github.com/nuplay/linkpreview
link safari sfsafariviewcontroller swift swiftpackagemanager swiftui uicomponent webview wkwebview
Last synced: 8 months ago
JSON representation
Preview with Link's meta information.(SwiftUI)
- Host: GitHub
- URL: https://github.com/nuplay/linkpreview
- Owner: NuPlay
- License: mit
- Created: 2021-12-08T02:10:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-30T06:59:13.000Z (over 4 years ago)
- Last Synced: 2025-07-04T10:05:40.694Z (11 months ago)
- Topics: link, safari, sfsafariviewcontroller, swift, swiftpackagemanager, swiftui, uicomponent, webview, wkwebview
- Language: Swift
- Homepage:
- Size: 38.1 KB
- Stars: 44
- Watchers: 1
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
LinkPreview(SwiftUI)
Preview with Link's meta information.
|  |  |
|-------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------- |
| Image | Gif |
## Get Started
```swift
import SwiftUI
import LinkPreview
struct LinkPreview_Test: View {
@State private var size: CGFloat = 350
var body: some View {
ZStack(alignment: .bottom){
ScrollView{
VStack{
LinkPreview(url: URL(string: "https://github.com/NuPlay/RichText"))
.backgroundColor(.blue)
.primaryFontColor(.white)
.secondaryFontColor(.white.opacity(0.6))
.titleLineLimit(3)
.frame(width: size, alignment: .center)
LinkPreview(url: URL(string: "https://github.com/NuPlay/ExpandableText"))
.titleLineLimit(20)
.frame(width: size, alignment: .center)
.type(.small)
LinkPreview(url: URL(string: "https://github.com/NuPlay/SwiftUI-SlideText"))
}
.padding(.horizontal, 24)
}
Slider(value: $size , in: 100...400, step: 1)
.padding(.horizontal, 24)
}
}
}
```
## Modifier(optional)
Modifier | Default
--- | ---
`.backgroundColor(_ backgroundColor: Color)` | `Color(.systemGray5)`
`.primaryFontColor(_ primaryFontColor: Color)` | `.primary`
`.secondaryFontColor(_ secondaryFontColor: Color)` | `.gray`
`.titleLineLimit(_ titleLineLimit: Int)` | `3`
`.type(_ type: LinkPreviewType(customType[.large, .small, .auto]))` | `.auto`