All Projects → eDeniska → figma-preview-swiftui

eDeniska / figma-preview-swiftui

Licence: MIT license
Figma component preview for your SwiftUI views

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to figma-preview-swiftui

BoxFeed
News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.
Stars: ✭ 112 (+119.61%)
Mutual labels:  figma, swiftui
Wiggles-iOS
Beautiful Puppy adoption app built to Demonstrate the SwiftUI and MVVM Architecture
Stars: ✭ 174 (+241.18%)
Mutual labels:  figma, swiftui
Figmatocode
Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
Stars: ✭ 2,299 (+4407.84%)
Mutual labels:  figma, swiftui
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-52.94%)
Mutual labels:  swiftui
StarWars
Minimal GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample (using StarWars endpoint - https://graphql.org/swapi-graphql)
Stars: ✭ 165 (+223.53%)
Mutual labels:  swiftui
Slipbox
The project is using Core Data with iCloud sync. It is a cross-platform app for iOS and macOS written in SwiftUI.
Stars: ✭ 49 (-3.92%)
Mutual labels:  swiftui
99StocksSwiftUI
SwiftUI app that fetches a list of companies, sort them by their share price and can show its details on a separate view
Stars: ✭ 34 (-33.33%)
Mutual labels:  swiftui
mobilePillowTalkLite
An iOS & SwiftUI server monitor tool for linux based machines using remote proc file system with script execution.
Stars: ✭ 421 (+725.49%)
Mutual labels:  swiftui
microsoft-figma
Produce sass/less variables files from figma
Stars: ✭ 18 (-64.71%)
Mutual labels:  figma
paragon firewall ce
Paragon Firewall for Mac
Stars: ✭ 63 (+23.53%)
Mutual labels:  swiftui
SwiftDown
📦 A themable markdown editor component for your SwiftUI apps.
Stars: ✭ 203 (+298.04%)
Mutual labels:  swiftui
AudioKitUI
Controls and Visualization for AudioKit apps
Stars: ✭ 126 (+147.06%)
Mutual labels:  swiftui
Figma-to-HTML
Figma to HTML/React and truly responsive
Stars: ✭ 27 (-47.06%)
Mutual labels:  figma
assistant
🤖 Bring your Figma design & development pipeline to the next level - with design to code, in-design-content-management, component management, tools for faster design
Stars: ✭ 451 (+784.31%)
Mutual labels:  figma
MultiModal
Use multiple .sheet, .alert, etc. modifiers in the same SwiftUI View
Stars: ✭ 49 (-3.92%)
Mutual labels:  swiftui
Solstice
🌅 An app that tells you how the daylight is changing
Stars: ✭ 41 (-19.61%)
Mutual labels:  swiftui
TheatricalMovieTrailers
iOS & macOS app written in SwiftUI that provides a nice trailer watching experience.
Stars: ✭ 27 (-47.06%)
Mutual labels:  swiftui
Apple-Developer-Roadmap
Cómo convertirte en Apple Developer (iOS, iPadOS, macOS, watchOS, tvOS)
Stars: ✭ 381 (+647.06%)
Mutual labels:  swiftui
SwiftReactor
A protocol which should help structure your data flow in SwiftUI (and UIKit).
Stars: ✭ 57 (+11.76%)
Mutual labels:  swiftui
ridesharing-ios
Ridesharing driver & rider sample apps using HyperTrack SDK
Stars: ✭ 97 (+90.2%)
Mutual labels:  swiftui

FigmaPreviewSwiftUI

A Figma component preview for your SwiftUI views. You can use Figma components instead of real views within your app until you implement them.

The Purpose

To speed up prototype development and test design choices before full-featured implementation.

Project is heavily inspired by flutter_figma_preview and jetpack-compose-figma-preview.

Requirements

FigmaPreviewSwiftUI uses SwiftUI features of macOS 11, iOS 14, tvOS 14, watchOS 7.

Setup

Add FigmaPreviewSwiftUI to your project via Swift Package Manager.

Create personal access token in account settings.

figma-access-token

Then pass this Figma access token via Environment.

struct FigmaPreviewApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(\.figmaAccessToken, "<figma-access-token>")
        }
    }
}

Usage

If you're using single Figma file for all designs, you can also pass it via Environment, so you won't need to specify it for each individual component (file id could be taken from Figma share link – typically, it goes after /file/).

struct FigmaPreviewApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(\.figmaAccessToken, "<figma-access-token>")
                .environment(\.figmaFileId, "<default-file-id>")
        }
    }
}

When you need to insert your Figma component, you can use two ways. Either you can specify component ID and optionally file ID directly.

struct ContentView: View {
    var body: some View {
        FigmaView(fileId: "<file-id>", componentId: "<component-id>")
    }
}

Alternatively, you can simply pass share link for the component.

struct ContentView: View {
    var body: some View {
        FigmaView(link: "https://www.figma.com/file/<12123123>/Name?node-id=<123123%3A3232131>")
    }
}

FigmaView will maintain its aspectRatio, but you'll need to control its frame when needed.

Component list to get component IDs

When you need to get component IDs for the elements, you can use FigmaComponentsList view (it comes with NavigationView, so you could put somewhere in developer menu of your app on early stages, or use separate app to browse components). Please note that only published components will be listed (this requires paid Figma subscription to publish these). Alternatively, you could still use share links of components from Figma. You can use share link, or file id to set up FigmaComponentsList view. Or, FigmaComponentsList could use file id passed via Environment.

struct ContentView: View {
    var body: some View {
        FigmaComponentsList()
    }
}

Reuse and contribution

You could use FigmaPreviewSwiftUI in any way you want. If you would like to contribute to the projects – contact me. Any ideas, suggestions, pull requests are welcome.

Anyway, ping me at @edeniska. :)

See also

If you use Zeplin for designs – check zeplin-preview-swiftui.

Roadmap

At the moment, there are couple of ideas of features to be added:

  • ability to overlay view with Figma representation to check the pixel-perfect differences
  • add UIKit version

License

FigmaPreviewSwiftUI is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].