{"id":32147096,"url":"https://github.com/arjun-dureja/modernslider","last_synced_at":"2026-02-18T22:01:29.854Z","repository":{"id":245609441,"uuid":"818436555","full_name":"arjun-dureja/ModernSlider","owner":"arjun-dureja","description":"A modern and customizable SwiftUI slider component","archived":false,"fork":false,"pushed_at":"2024-10-12T19:39:11.000Z","size":1112,"stargazers_count":42,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T18:16:52.173Z","etag":null,"topics":["ios","ipados","macos","slider","swift","swift-library","swift-package","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjun-dureja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T21:17:40.000Z","updated_at":"2026-01-09T06:08:59.000Z","dependencies_parsed_at":"2024-06-23T01:58:36.056Z","dependency_job_id":"89c1ffdc-2beb-487a-86cf-2bb837c89f1d","html_url":"https://github.com/arjun-dureja/ModernSlider","commit_stats":null,"previous_names":["arjun-dureja/modernslider"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arjun-dureja/ModernSlider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun-dureja%2FModernSlider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun-dureja%2FModernSlider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun-dureja%2FModernSlider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun-dureja%2FModernSlider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjun-dureja","download_url":"https://codeload.github.com/arjun-dureja/ModernSlider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun-dureja%2FModernSlider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","ipados","macos","slider","swift","swift-library","swift-package","swift-package-manager","swiftui"],"created_at":"2025-10-21T08:45:17.178Z","updated_at":"2026-02-18T22:01:29.848Z","avatar_url":"https://github.com/arjun-dureja.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ModernSlider\n\n![ModernSlider Image](https://github.com/arjun-dureja/ModernSlider/blob/main/Assets/hero-image.png)\n\n[![Swift](https://img.shields.io/badge/swift-orange.svg)](https://swift.org)\n[![GitHub stars](https://img.shields.io/github/stars/arjun-dureja/ModernSlider.svg)](https://github.com/arjun-dureja/ModernSlider/stargazers)\n[![GitHub license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/arjun-dureja/ModernSlider/blob/main/LICENSE)\n[![Platform](https://img.shields.io/badge/platform-iOS%20|%20macOS%20|%20iPadOS-blue.svg)](https://developer.apple.com)\n\n`ModernSlider` is a customizable slider component for SwiftUI, inspired by the macOS Control Center sliders, that provides a sleek and modern interface for selecting values from a range.\n\n## Features\n\n- Customizable range, width, height, system image, and color\n- Optional title with a background view\n- Smooth sliding animation\n- Callbacks for value changes and drag end events\n- Support for light and dark mode\n\n\u003cimg src=\"https://github.com/arjun-dureja/ModernSlider/blob/main/Assets/example-app.png\" width=\"400\" /\u003e\n\n## Requirements\n\n- iOS 14.0+\n- macOS 11.0+\n- Mac Catalyst 15.0+\n\n## Installation\n\n### Swift Package Manager\n\nTo add `ModernSlider` to your project, follow these steps:\n\n1. Open your project in Xcode.\n1. Go to File \u003e Add Packages.\n1. Enter the repository URL: https://github.com/arjun-dureja/ModernSlider\n1. Select the ModernSlider package and add it to your project.\n\n---\n\nAlternatively, add the following to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/arjun-dureja/ModernSlider.git\", from: \"1.0.0\")\n]\n```\n\n## Usage\n\nFirst, import the ModernSlider package in your SwiftUI view:\n\n```swift\nimport ModernSlider\n```\n\nThen, you can use the ModernSlider in your SwiftUI views:\n\n```swift\nstruct ContentView: View {\n    @State private var sliderValue = 50.0\n\n    var body: some View {\n        ModernSlider(\n            \"Brightness\",\n            systemImage: \"sun.max.fill\",\n            value: $sliderValue,\n            in: 5...100,\n            onChange: { newValue in\n                print(\"Slider value changed to \\(newValue)\")\n            },\n            onChangeEnd: { finalValue in\n                print(\"Sliding ended with value \\(finalValue)\")\n            }\n        )\n    }\n}\n```\n\n\u003cimg src=\"https://github.com/arjun-dureja/ModernSlider/blob/main/Assets/example-1.gif\" width=\"400\" /\u003e\n\n### Customization\n\n#### ModernSlider offers various customization options:\n\nCustom image, width, height, and color:\n\n```swift\nModernSlider(\n    \"Volume\",\n    systemImage: \"speaker.wave.2.fill\",\n    sliderWidth: 300,\n    sliderHeight: 30,\n    sliderColor: .blue,\n    value: $volume\n)\n```\n\u003cimg src=\"https://github.com/arjun-dureja/ModernSlider/blob/main/Assets/example-2.gif\" width=\"400\" /\u003e\n\nNo title:\n```swift\nModernSlider(\n    systemImage: \"circle\",\n    value: $value\n)\n```\n\u003cimg src=\"https://github.com/arjun-dureja/ModernSlider/blob/main/Assets/example-3.gif\" width=\"400\" /\u003e\n\n## API Reference\n\n### ModernSlider\n\n```swift\npublic init(\n    _ title: String? = nil,\n    systemImage: String,\n    sliderWidth: CGFloat = 250,\n    sliderHeight: CGFloat = 25,\n    sliderColor: Color = .white,\n    value: Binding\u003cDouble\u003e,\n    in range: ClosedRange\u003cDouble\u003e = 0...100,\n    onChange: ((Double) -\u003e Void)? = nil,\n    onChangeEnd: ((Double) -\u003e Void)? = nil\n)\n```\n\n#### Parameters\n\n- `title`: An optional string to describe the data the slider represents.\n- `systemImage`: A string representing the system image name for the slider thumb.\n- `sliderWidth`: The width of the slider track. Defaults to 250.\n- `sliderHeight`: The height of the slider track and thumb. Defaults to 25.\n- `sliderColor`: The color of the slider's fill and thumb. Defaults to white.\n- `value`: A binding to the current value of the slider.\n- `range`: A closed range representing the minimum and maximum values for the slider. Defaults to 0...100.\n- `onChange`: An optional closure that is called when the slider value changes.\n- `onChangeEnd`: An optional closure that is called when the dragging ends.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n`ModernSlider` is available under the MIT license. See the [LICENSE](https://github.com/arjun-dureja/ModernSlider/blob/main/LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-dureja%2Fmodernslider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjun-dureja%2Fmodernslider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-dureja%2Fmodernslider/lists"}