Luminare
repository·main·Indexed 41 days ago
https://github.com/mrkai77/luminareA 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.
What's inside Luminare
- Luminare is a SwiftUI framework for macOS application development. It provides a collection of pre-styled components designed to maintain a consistent design language across your application. It is built to be modular and reusable, using a declarative syntax that integrates naturally with SwiftUI.
Overview of Luminare features
mainLuminare 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.
Customize indicator colors with LuminareStepperProminentIndicators
mainYou can useLuminareStepperProminentIndicatorsto specify custom prominent colors for indicators that represent specific values, allowing you to highlight certain states or milestones within the stepper.Format the color code in LuminareColorPicker
mainWhen configuring theLuminareColorPickerstyle, you can use theformatparameter to control how the hex color code is displayed. For more advanced formatting options, refer toStringFormatStyle.Use LuminareWindow for a coherent design experience
mainLuminareWindowprovides 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
LuminareDividedStackinside theLuminareWindow.Choose between LuminareCompactPicker and LuminareSliderPicker
mainBoth components are used for selecting discrete options, but they differ in visibility and composition:
LuminareCompactPicker(Segmented): Displays all options at the same time on the screen.LuminareSliderPicker: Only displays the current selection. Use this when you want the picker to compose with a label.
Configure sidebar tabs with LuminareTabItem
mainTo populate aLuminareSidebarTab, you useLuminareTabItemobjects. These items represent the individual selectable entries within the sidebar navigation.Choose between LuminareCompactPicker and LuminarePicker
mainDeciding which picker to use depends on the layout and purpose of your selection UI:
- Use
LuminareCompactPickerwhen 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
LuminarePickerwhen you want to display a grid of options. For switching between paged views, a compact 1-rowLuminarePickeris preferred as it aligns better with theLuminaredesign language.
- Use
Configure LuminareStepper range and snapping with LuminareStepperSource
mainUseLuminareStepperSourceto define how the stepper behaves regarding its value range and snapping logic. This determines how the component handles increments and the boundaries of the selectable values.Configure LuminareStepper direction and alignment
mainThe
LuminareSteppercomponent supports both horizontal and vertical orientations usingLuminareStepperDirection.- Direction: You can set the orientation to horizontal or vertical. Using an
alternatedirection will invert the side representing arithmetically larger values. - Alignment: Depending on the chosen direction, you can adjust the position of the indicators using
LuminareStepperAlignment.
- Direction: You can set the orientation to horizontal or vertical. Using an
Add Luminare to your project via Swift Package Manager
mainYou can integrate Luminare into your macOS project using Swift Package Manager (SPM) by following these steps in Xcode:
- Open your project in Xcode.
- Navigate to
File>Swift Packages>Add Package Dependency.... - Enter the Luminare repository URL.
- Select your desired version and add the package to your project.
Use LuminareCompose for labeled content layouts
mainThe
LuminareComposecomponent provides a simple way to create layouts consisting of a content area and an optional label, similar to SwiftUI'sLabeledContent. You can use it within layout containers like@Rowand@Columnto structure your UI.There are two primary ways to initialize it:
- With a trailing closure for the label: Use this when you want to provide a custom view as the label.
- 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 }