AxisRatingBar for SwiftUI

This library is a UI control for iOS and macOS developed with SwiftUI. You can display ratings along the horizontal/vertical axis and receive ratings from users. You can use any view that conforms to the View protocol, not just the star shape.

Platforms iOS macOS instagram SPM MIT


Horizontal Vertical



/// Initializes `ARConstant`
/// - Parameters:
///   - rating: The number of views filled is typically between 1 and 5. The view is displayed according to the fill mode setting. The default value is `5`.
///   - size: The size of the individual view. The default value is `CGSize(width: 44, height: 44)`.
///   - spacing: The spacing between the view and the view. The default value is `0`
///   - fillMode: Defines how the view is filled when the rating is not an integer number. The default value is `.half`.
///   - axisMode: Defines the horizontal/vertical orientation of the rating bar. The default value is `.horizontal`.
///   - valueMode: The mode of the filled value. The default value is `.ratio`
///   - disabled: A condition that controls whether users can interact with rating bar. The default value is 'false'
///   - animation: The animation effect of the view being filled. The default value is `.easeOut(duration: 0.16)`

AxisRatingBar(value: $value, constant: constant) {
    /// A view builder for background views.
    ARStar(count: 5), innerRatio: 1)
} foreground: {
    /// A view builder for foreground views.
    ARStar(count: 5, innerRatio: 1)

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding AxisRatingBar as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "", .branch("main"))


instagram : @dev.fabula email : [email protected]


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


View Github