{"id":25197501,"url":"https://github.com/sidevesh/react-native-snackbar-component","last_synced_at":"2025-04-04T11:16:02.931Z","repository":{"id":18415241,"uuid":"84238613","full_name":"sidevesh/react-native-snackbar-component","owner":"sidevesh","description":"A snackbar component for Android and iOS","archived":false,"fork":false,"pushed_at":"2024-04-21T19:33:32.000Z","size":5553,"stargazers_count":186,"open_issues_count":6,"forks_count":74,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-26T02:34:23.691Z","etag":null,"topics":["material-design","react-native","snackbar"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/sidevesh.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":"2017-03-07T19:38:10.000Z","updated_at":"2024-06-18T14:07:34.833Z","dependencies_parsed_at":"2023-07-17T20:21:47.847Z","dependency_job_id":"db0613be-d56f-47f9-92cb-000666b8478b","html_url":"https://github.com/sidevesh/react-native-snackbar-component","commit_stats":{"total_commits":112,"total_committers":15,"mean_commits":7.466666666666667,"dds":0.5714285714285714,"last_synced_commit":"db0d37a18cf3912a3e4b5193779b6a24a5730a83"},"previous_names":["sidevesh/react-native-snackbar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidevesh%2Freact-native-snackbar-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidevesh%2Freact-native-snackbar-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidevesh%2Freact-native-snackbar-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidevesh%2Freact-native-snackbar-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidevesh","download_url":"https://codeload.github.com/sidevesh/react-native-snackbar-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097983,"owners_count":20883128,"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":["material-design","react-native","snackbar"],"created_at":"2025-02-10T01:52:48.813Z","updated_at":"2025-04-04T11:16:02.906Z","avatar_url":"https://github.com/sidevesh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-snackbar-component\nA snackbar component for Android and iOS, customizable and simple.\n\n![Snackbar demo](https://media.giphy.com/media/zChTSWog7TNmM/giphy.gif)\n![With fab](https://media.giphy.com/media/6oCCk98unakbC/giphy.gif)\n\nSee [Google Material Design](https://material.io/guidelines/components/snackbars-toasts.html) for more info on Snackbars.\n\n## Installation\n\n```sh\nnpm install --save react-native-snackbar-component\n```\n\n## Basic Usage\n\n```javascript\nimport SnackBar from 'react-native-snackbar-component'\n```\n\n## Code\n\n```js\n\u003cSnackBar visible={true} textMessage=\"Hello There!\" actionHandler={()=\u003e{console.log(\"snackbar button clicked!\")}} actionText=\"let's go\"/\u003e\n```\n## Options\n| Prop        | Type           | Effect  | Default Value |\n| ------------- |-------------| -----| -----|\n| visible | boolean | Show or hide the snackbar | none |\n| textMessage | string / function | The main message text, can also supply a function returning JSX to render custom message UI | none |\n| actionHandler | function | Function to be called when button is pressed, if absent no action button is shown | none |\n| actionText | message | The text of action button, will be uppercased automatically | none |\n| backgroundColor | color | The background color of snackbar | #484848 |\n| accentColor | color | The color of action button text | orange |\n| messageColor | color | The color of main message text | #FFFFFF |\n| distanceCallback | function | Function to be caled whenever snackbar moves in and out or changes layout, the function will be supplied a number indicating distance taken up by snackbar on bottom or top, based on position. | (distance) =\u003e {} |\n| position | string | The position of the snackbar: top, bottom | bottom |\n| top / bottom / left / right | number | Use these to position the snackbar | 0 |\n| autoHidingTime | number | How many milliseconds the snackbar will be hidden | 0 (Do not hide automatically) |\n| containerStyle | object | Override or add style to the root container View | {} |\n| messageStyle | object | Override or add style to the message Text | {} |\n| actionStyle | object | Override or add style to the action button Text | {} |\n\n## Note\n\n* When visible prop is changed, the snackbar will be animated in/out of screen\n* The snackbar will not auto-dismiss by itself, for auto-dismiss use setTimeout() and change value passed to prop to false,  \n  **OR** you can set `autoHidingTime` to any particular value to hide the snackbar itself, although you will need to reset `visible` to false manually after the `autoHidingTime` period is over, since `visible` is controlled from outside.\n* This works great together with [react-native-fab](https://github.com/sidevesh/react-native-fab). See [demo](https://github.com/sidevesh/snackbar-and-fab-demo) for example and instructions how to.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidevesh%2Freact-native-snackbar-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidevesh%2Freact-native-snackbar-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidevesh%2Freact-native-snackbar-component/lists"}