Luminare

repository·main·Indexed 41 days ago

https://github.com/mrkai77/luminare

A SwiftUI framework for macOS that provides a collection of pre-styled, modular components to build visually consistent user interfaces with minimal boilerplate. It includes specialized components such as LuminareWindow, LuminareColorPicker, LuminareList, and various picker and stepper implementations designed to follow a consistent design language.

Tokens
3.9K
Snippets
11
Records
27
Agent score
51%

What's inside Luminare

  1. Overview of Luminare features

    main

    Luminare is a SwiftUI framework for macOS that provides pre-styled components following a consistent design language. Key characteristics include:

    • Declarative Syntax: Uses a syntax consistent with standard SwiftUI.
    • Modularity: Designed for reusability to minimize boilerplate when building custom interfaces.
    • Consistent Styling: Utilizes a mix of system-defined and custom modifiers to ensure visual uniformity across components.
  2. Use LuminareWindow for a coherent design experience

    main

    LuminareWindow provides a pre-configured window environment designed to maintain design coherence across your application.

    Key characteristics:

    • It features standard traffic lights (window controls) but removes the traditional title bar section.
    • All window content is automatically wrapped within a LuminareView.

    To achieve a standard vertically divided layout (common in sidebar-based applications), it is recommended to place a LuminareDividedStack inside the LuminareWindow.

  3. Choose between LuminareCompactPicker and LuminarePicker

    main

    Deciding which picker to use depends on the layout and purpose of your selection UI:

    • Use LuminareCompactPicker when you need to display options in a menu or as horizontally organized segments. It is recommended for toggling between controls (e.g., switching between light and dark modes).
    • Use LuminarePicker when you want to display a grid of options. For switching between paged views, a compact 1-row LuminarePicker is preferred as it aligns better with the Luminare design language.
  4. Configure LuminareStepper direction and alignment

    main

    The LuminareStepper component supports both horizontal and vertical orientations using LuminareStepperDirection.

    • Direction: You can set the orientation to horizontal or vertical. Using an alternate direction will invert the side representing arithmetically larger values.
    • Alignment: Depending on the chosen direction, you can adjust the position of the indicators using LuminareStepperAlignment.
  5. Add Luminare to your project via Swift Package Manager

    main

    You can integrate Luminare into your macOS project using Swift Package Manager (SPM) by following these steps in Xcode:

    1. Open your project in Xcode.
    2. Navigate to File > Swift Packages > Add Package Dependency....
    3. Enter the Luminare repository URL.
    4. Select your desired version and add the package to your project.
  6. Use LuminareCompose for labeled content layouts

    main

    The LuminareCompose component provides a simple way to create layouts consisting of a content area and an optional label, similar to SwiftUI's LabeledContent. You can use it within layout containers like @Row and @Column to structure your UI.

    There are two primary ways to initialize it:

    1. With a trailing closure for the label: Use this when you want to provide a custom view as the label.
    2. With a title string: Use LuminareCompose("Title") when you only need a simple text label for the content.
    // Example 1: Custom label view
    LuminareCompose {
        // Content view
    } label: {
        // Label view
    }
    
    // Example 2: Simple title string
    LuminareCompose("Title") {
        // Content view
    }