All Projects → VakhoKontridze → Vcomponents

VakhoKontridze / Vcomponents

Licence: mit
VComponents is a SwiftUI framework that contains 40+ customizable UI components

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Vcomponents

Element
Programmatic UI for macOS
Stars: ✭ 855 (+630.77%)
Mutual labels:  framework, components
Apprun
AppRun is a JavaScript library for developing high-performance and reliable web applications using the elm inspired architecture, events and components.
Stars: ✭ 1,087 (+829.06%)
Mutual labels:  framework, component
Jcnavigator
A decoupled navigator framework of jumping between modules or apps for iOS development.
Stars: ✭ 33 (-71.79%)
Mutual labels:  framework, component
Awesome Ui Component Library
Curated list of framework component libraries for UI styles/toolkit
Stars: ✭ 702 (+500%)
Mutual labels:  framework, components
Gu
A web ui library for Go. [DEPRECATED]
Stars: ✭ 102 (-12.82%)
Mutual labels:  component, components
Catberry
Catberry is an isomorphic framework for building universal front-end apps using components, Flux architecture and progressive rendering.
Stars: ✭ 793 (+577.78%)
Mutual labels:  framework, components
Antmove
小程序转换器,基于支付宝/微信小程序, 轻松地转换成其它平台的小程序。
Stars: ✭ 1,078 (+821.37%)
Mutual labels:  framework, components
San
A fast, portable, flexible JavaScript component framework
Stars: ✭ 4,514 (+3758.12%)
Mutual labels:  framework, component
Capivarajs
✌️ Um novo jeito de criar componentes híbridos.
Stars: ✭ 97 (-17.09%)
Mutual labels:  framework, components
Akane
Lightweight native iOS MVVM framework
Stars: ✭ 92 (-21.37%)
Mutual labels:  framework, component
React Fontawesome
A React Font Awesome component.
Stars: ✭ 662 (+465.81%)
Mutual labels:  component, components
Realtaiizor
C# WinForm UI/UX Component Library
Stars: ✭ 109 (-6.84%)
Mutual labels:  framework, component
Velocityx
A minimalist Flutter framework for rapidly building custom designs.
Stars: ✭ 595 (+408.55%)
Mutual labels:  framework, component
Fprime
F' - A flight software and embedded systems framework
Stars: ✭ 8,642 (+7286.32%)
Mutual labels:  framework, components
Vuesax
New Framework Components for Vue.js 2
Stars: ✭ 5,293 (+4423.93%)
Mutual labels:  framework, component
React Components
React components
Stars: ✭ 47 (-59.83%)
Mutual labels:  component, components
Mam mol
$mol - fastest reactive micro-modular compact flexible lazy ui web framework.
Stars: ✭ 385 (+229.06%)
Mutual labels:  framework, components
Preferencesfx
A framework for easily creating a UI for application settings / preferences.
Stars: ✭ 449 (+283.76%)
Mutual labels:  framework, component
Made With Love
🚀 An experimental project which demonstrates an Angular Package which contains Angular Elements and Schematics
Stars: ✭ 67 (-42.74%)
Mutual labels:  component, components
Atlas.js
A component-based Node.js library to reduce boilerplate and provide sane project structure 🍻
Stars: ✭ 108 (-7.69%)
Mutual labels:  framework, components

Vakho's Components (VComponents)

Table of Contents

Description

VComponents is a SwiftUI framework that contains 40+ customizable UI components.

Framework supports iOS 14.0 and up.

Project is being developed on macOS 11.0 Big Sur in XCode 12.

Demo

Project contains demo app, that can be run to showcase all components.

DemoApp

Installation

Framework doesn't support CocoaPods or Carthage.

Swift Package Manager

Add https://github.com/VakhoKontridze/VComponents as a Swift Package in Xcode and follow the instructions.

SPM1

Manual

  1. Download VComponents.xcframework.

  2. Extract the zip.

  3. Drag VComponents.xcframework into your project.

ManualInstallation1

  1. Select "Copy items if needed" and click Finish.

ManualInstallation2

  1. Go to the target settings for your app, under "General" tab, find "Frameworks, Libraries, and Embedded Content". Set the VComponents.xcframework to “Embed & Sign”.

ManualInstallation3

Building Your Own Target

Since VComponents is open-source, you can clone the project and build the framework target yourself.

Components

Buttons. VBaseButton, VPrimaryButton, VSecondaryButton, VSquareButton, VPlainButton, VChevronButton, VCloseButton, VNavigationLink, VLink

State Pickers. VToggle, VCheckBox, VRadioButton

Item Pickers. VSegmentedPicker, VMenuPicker, VWheelPicker

Value Pickers. VStepper, VSlider, VRangeSlider

Inputs. VBaseTextField, VTextField

Lists. VBaseList, VList, VSectionList, VAccordion

Navigation. VTabNavigationView, VNavigationView

Modals. VModal, VHalfModal, VSideBar, VDialog, VMenu, VActionSheet

Messages. VToast

Indicators. VSpinner, VProgressBar, VPageIndicator

Misc. VText, VSheet, VLazyScrollView, VBaseView

Guidelines

Models

Components are not meant to be customized like you would a native SwiftUI component.

Instead, model can be passed as parameter to initializers. This parameter has default value, and is not required every time you create a view.

Models are structs with default values. They break down into 5 sub-structs: Layout, Colors, Fonts, Animations, and Misc.

For instance, changing foreground color of VSecondaryButton can be achieved by passing a custom model.

Not Preferred:

var body: some View {
    VSecondaryButton(
        action: doSomething,
        title: "Lorem ipsum"
    )
        .foregroundColor(.black)
}

Preferred:

let model: VSecondaryButtonModel = {
    var model: VSecondaryButtonModel = .init()
    
    model.colors.textContent = .init(
        enabled: .black,
        pressed: .gray,
        disabled: .gray
    )
    
    return model
}()

var body: some View {
    VSecondaryButton(
        model: model,
        action: doSomething,
        title: "Lorem ipsum"
    )
}

Alternately, you can create static instances of models for reusability.

var body: some View {
    VSecondaryButton(
        model: .myCustomModel,
        action: doSomething,
        title: "Lorem ipsum"
    )
}

extension VSecondaryButtonModel {
    static let myCustomModel: VSecondaryButtonModel = {
        var model: VSecondaryButtonModel = .init()
        
        model.colors.textContent = .init(
            enabled: .black,
            pressed: .gray,
            disabled: .gray
        )
        
        return model
    }()
}

Types

Some components take type as parameter. Types are represented as enums, as more can be added in the future.

For instance, VPageIndicator has three types: Finite, Infinite, and Auto. Unlike models, types may be required in some instances. For other enums, a default case is provided.

var body: some View {
    VStack(content: {
        VPageIndicator(type: .finite, total: 9, selectedIndex: 4)
        
        VPageIndicator(type: .infinite(), total: 99, selectedIndex: 4)
        
        VPageIndicator(type: .auto(), total: 99, selectedIndex: 4)
    })
}

States

States in components are represented as enums. They can be passed as a parameter to initializers, must most default to enabled.

Some enums contain case disabled, which is preffered over SwiftUI's .disabled() modifier. .disabled() modifier changes color and opacity of a native Button, but this behavior is limited in nature. Some components in this framework contain multiple subviews, which require a more in-depth customization. For instance, we can customize VSecondaryButton's foreground, background, and border colors separately for enabled, pressed, and disabled states. Also keep in mind, that using a native modifier instead of state property may cause unintended side-effects.

Not Preferred:

var body: some View {
    VSecondaryButton(
        action: doSomething,
        title: "Press"
    )
        .disabled(true)
}

Preferred:

var body: some View {
    VSecondaryButton(
        state: .disabled,
        action: doSomething,
        title: "Press"
    )
}

Some enums can also contain additional cases, such as focused for VBaseTextField and VTextField.

Animations

VComponents approaches animations as bound to components and their models, and not to state. Which means, that to modify a state of component with an animation, you need to pass a custom model.

Not Preferred:

@State var isOn: Bool = false

var body: some View {
    VStack(content: {
        VToggle(isOn: $isOn, title: "Lorem ipsum")
        
        VSecondaryButton(
            action: { withAnimation(nil, { isOn.toggle() }) },
            title: "Toggle"
        )
    })
}

Preferred:

@State var isOn: Bool = false

let model: VToggleModel = {
    var model: VToggleModel = .init()
    model.animations.stateChange = nil
    return model
}()

var body: some View {
    VStack(content: {
        VToggle(model: model, isOn: $isOn, title: "Lorem ipsum")
        
        VSecondaryButton(
            action: { isOn.toggle() },
            title: "Toggle"
        )
    })
}

First method is not only not preferred, but it will also not work. Despite specifying nil to change state, VToggle would still use its default animation.

Components manage state parameters internally, and animations used to change them externally do not have any effect.

Thought process behind his design choice was to centralize animations to model.

Components also prevent themselves from modifying external state with an animation.

Versioning

Major. Major changes, such as new component or type

Minor. Minor changes, such as new properties in models

Patch. Bug fixes and improvements

Contact

e-mail: [email protected]

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].