{"id":20881440,"url":"https://github.com/js-bhavyansh/segmented_buttons","last_synced_at":"2025-09-08T13:35:06.760Z","repository":{"id":252106457,"uuid":"839430804","full_name":"js-bhavyansh/Segmented_Buttons","owner":"js-bhavyansh","description":"Segmented button UI in Jetpack Compose with dynamic options and customizable styles.","archived":false,"fork":false,"pushed_at":"2024-08-08T09:44:21.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T10:07:56.225Z","etag":null,"topics":["android-studio","jetpack-compose","kotlin","material-ui","segmented-button"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-bhavyansh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-07T15:38:06.000Z","updated_at":"2025-01-04T07:07:48.000Z","dependencies_parsed_at":"2024-08-07T19:34:58.982Z","dependency_job_id":"76192d83-58ce-43b7-95ab-2b5705e92945","html_url":"https://github.com/js-bhavyansh/Segmented_Buttons","commit_stats":null,"previous_names":["bhavyansh03-tech/segmented_buttons","js-bhavyansh/segmented_buttons"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FSegmented_Buttons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FSegmented_Buttons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FSegmented_Buttons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FSegmented_Buttons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bhavyansh","download_url":"https://codeload.github.com/js-bhavyansh/Segmented_Buttons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258498,"owners_count":20262300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["android-studio","jetpack-compose","kotlin","material-ui","segmented-button"],"created_at":"2024-11-18T07:24:53.948Z","updated_at":"2025-03-12T17:15:37.370Z","avatar_url":"https://github.com/js-bhavyansh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Segmented Buttons UI in Jetpack Compose\n\nThis project showcases a segmented button UI using Jetpack Compose's `SingleChoiceSegmentedButtonRow`. It allows for easy navigation between different options with a visually appealing design.\n\n## Features\n\n- Dynamic segmented buttons with selectable options.\n- Smooth transitions between different segments.\n- Customizable button shapes and styles.\n\n## Screenshots\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/30380980-666a-4c54-90e6-9f609496ca4f\" alt=\"First Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/37d30c91-4459-4ea8-8265-2a1481d01e1c\" alt=\"Second Screenshot\" style=\"width: 200px; height: auto;\"\u003e\n\u003c/div\u003e\n\n## Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/Bhavyansh03-tech/Segmented_Buttons.git\n    ```\n\n2. Open the project in Android Studio.\n\n3. Sync the project with Gradle files.\n\n## Usage\n\nTo use the segmented button UI in your project, integrate the `SingleChoiceSegmentedButtonRow` and `SegmentedButton` composables as shown below:\n\n```kotlin\n@OptIn(ExperimentalMaterial3Api::class)\nclass MainActivity : ComponentActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        enableEdgeToEdge()\n        setContent {\n            SegmentedButtonsTheme {\n\n                var selectedIndex by remember {\n                    mutableIntStateOf(0)\n                }\n\n                val options = remember {\n                    mutableStateListOf(\"Music\", \"Movies\", \"Podcasts\")\n                }\n\n                Box(\n                    modifier = Modifier.fillMaxWidth(),\n                    contentAlignment = Alignment.Center\n                ) {\n                    SingleChoiceSegmentedButtonRow {\n                        options.forEachIndexed { index, option -\u003e\n                            SegmentedButton(\n                                selected = selectedIndex == index,\n                                onClick = { selectedIndex = index },\n                                shape = SegmentedButtonDefaults.itemShape(\n                                    index = index,\n                                    count = options.size\n                                )\n                            ) {\n                                Text(text = option)\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n## Contact\n\nFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fsegmented_buttons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bhavyansh%2Fsegmented_buttons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fsegmented_buttons/lists"}