{"id":18725516,"url":"https://github.com/jacklam718/react-native-dialog-component","last_synced_at":"2025-04-12T16:09:07.280Z","repository":{"id":73766288,"uuid":"80328106","full_name":"jacklam718/react-native-dialog-component","owner":"jacklam718","description":"A react native dialog component support custom animation for IOS \u0026 Android.","archived":false,"fork":false,"pushed_at":"2018-08-12T15:24:28.000Z","size":2001,"stargazers_count":81,"open_issues_count":11,"forks_count":29,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T10:36:17.532Z","etag":null,"topics":["android","animation","component","dialog","ios","react","react-native","react-native-dialog"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-dialog-component","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/jacklam718.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-01-29T04:14:49.000Z","updated_at":"2024-01-27T12:48:48.000Z","dependencies_parsed_at":"2023-03-23T23:47:29.298Z","dependency_job_id":null,"html_url":"https://github.com/jacklam718/react-native-dialog-component","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklam718%2Freact-native-dialog-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklam718%2Freact-native-dialog-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklam718%2Freact-native-dialog-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklam718%2Freact-native-dialog-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacklam718","download_url":"https://codeload.github.com/jacklam718/react-native-dialog-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248594139,"owners_count":21130312,"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","animation","component","dialog","ios","react","react-native","react-native-dialog"],"created_at":"2024-11-07T14:10:36.363Z","updated_at":"2025-04-12T16:09:07.274Z","avatar_url":"https://github.com/jacklam718.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## React Native Dialog Component\nReact Native Dialog Component for iOS \u0026 Android.\n\nPull request are welcomed. Please follow [Airbnb JS Style Guide](https://github.com/airbnb/javascript)\n\n#### Preview\n\u003cimg src=\"https://jacklam718.github.io/react-native-dialog-component/resources/react-native-dialog-component.gif\" width=\"300\"\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://jacklam718.github.io/react-native-dialog-component/resources/screenshot-1.png\" width=\"150\"\u003e\n\u003cimg src=\"https://jacklam718.github.io/react-native-dialog-component/resources/screenshot-2.png\" width=\"150\"\u003e\n\u003cimg src=\"https://jacklam718.github.io/react-native-dialog-component/resources/screenshot-3.png\" width=\"150\"\u003e\n\n\n## Try With Exponent\n[Exponent](https://exp.host/@jacklam718/dialog-component-explorer)\n\n## Installation\n\n```\nnpm install --save react-native-dialog-component\n# OR\nyarn add react-native-dialog-component\n```\n\n## Exposed Modules\n\n* DialogManager\n* DialogComponent\n* Dialog\n* DialogContent\n* DialogButton\n* DialogTitle\n* Overlay\n* Animation\n* FadeAnimation\n* ScaleAnimation\n* SlideAnimation\n\n\n## Examples\n[Example](https://github.com/jacklam718/react-native-dialog-component/blob/master/dialogComponentExample/DialogComponentExample.js)\n\n\n## Usage With `DialogManager`\n```javascript\nimport DialogManager, { ScaleAnimation, DialogContent } from 'react-native-dialog-component';\n```\n\n#### show\n```javascript\nDialogManager.show({\n  title: 'Dialog',\n  titleAlign: 'center',\n  animationDuration: 200,\n  ScaleAnimation: new ScaleAnimation(),\n  children: (\n    \u003cDialogContent\u003e\n      \u003cView\u003e\n        \u003cText\u003e\n          React Native Dialog Component\n        \u003c/Text\u003e\n      \u003c/View\u003e\n    \u003c/DialogContent\u003e\n  ),\n}, () =\u003e {\n  console.log('callback - show');\n});\n```\n\n#### update\n```javascript\nDialogManager.update({\n  title: 'Dialog Updated',\n  titleAlign: 'center',\n  animationDuration: 200,\n  ScaleAnimation: new ScaleAnimation(),\n  children: (\n    \u003cDialogContent\u003e\n      \u003cView\u003e\n        \u003cText\u003e\n          New Content\n        \u003c/Text\u003e\n      \u003c/View\u003e\n    \u003c/DialogContent\u003e\n  ),\n}, () =\u003e {\n  console.log('callback - update dialog');\n});\n```\n\n#### dismiss\n```javascript\n// dismiss dialog\nDialogManager.dismiss(() =\u003e {\n  console.log('callback - dismiss');\n});\n```\n\n#### dismiss all\n```javascript\nDialogManager.dismissAll(() =\u003e {\n  console.log('callback - dismiss all');\n});\n```\n\n## Usage with `DialogComponent`\n```javascript\nimport { DialogComponent }from 'react-native-dialog-component';\n\n\u003cView style={styles.container}\u003e\n  \u003cButton\n    text=\"Show Dialog\"\n    onPress={() =\u003e {\n      this.dialogComponent.show();\n    }}\n  /\u003e\n  \u003cDialogComponent\n    ref={(dialogComponent) =\u003e { this.dialogComponent = dialogComponent; }}\n  \u003e\n    \u003cView\u003e\n      \u003cText\u003eHello\u003c/Text\u003e\n    \u003c/View\u003e\n  \u003c/DialogComponent\u003e\n\u003c/View\u003e\n```\n\n## Usage - With Animation\n```javascript\nimport { DialogComponent, SlideAnimation } from 'react-native-dialog-component';\n\n\u003cView style={styles.container}\u003e\n  \u003cButton\n    text=\"Show Dialog\"\n    onPress={() =\u003e {\n      this.dialogComponent.show();\n    }}\n  /\u003e\n  \u003cDialogComponent\n    ref={(dialogComponent) =\u003e { this.dialogComponent = dialogComponent; }}\n    dialogAnimation = { new SlideAnimation({ slideFrom: 'bottom' }) }\n  \u003e\n    \u003cView\u003e\n      \u003cText\u003eHello\u003c/Text\u003e\n    \u003c/View\u003e\n  \u003c/DialogComponent\u003e\n\u003c/View\u003e\n```\n\n## Usage - With Dialog Title\n```javascript\nimport { DialogComponent, DialogTitle } from 'react-native-dialog-component';\n\n\u003cView style={styles.container}\u003e\n  \u003cButton\n    text=\"Show Dialog\"\n    onPress={() =\u003e {\n      this.dialogComponent.show();\n    }}\n  /\u003e\n  \u003cDialogComponent\n    title={\u003cDialogTitle title=\"Dialog Title\" /\u003e}\n    ref={(dialogComponent) =\u003e { this.dialogComponent = dialogComponent; }}\n  \u003e\n    \u003cView\u003e\n      \u003cText\u003eHello\u003c/Text\u003e\n    \u003c/View\u003e\n  \u003c/DialogComponent\u003e\n\u003c/View\u003e\n```\n\n## Usage - Wrape the content use DialogContent\n```javascript\nimport { DialogComponent, DialogTitle } from 'react-native-dialog-component';\n\n\u003cView style={styles.container}\u003e\n  \u003cButton\n    text=\"Show Dialog\"\n    onPress={() =\u003e {\n      this.dialogComponent.show();\n    }}\n  /\u003e\n  \u003cDialogComponent\n    dialogTitle={\u003cDialogTitle title=\"Dialog Title\" /\u003e}\n    ref={(dialogComponent) =\u003e { this.dialogComponent = dialogComponent; }}\n  \u003e\n    \u003cDialogContent\u003e\n      \u003cView\u003e\n        \u003cText\u003eHello\u003c/Text\u003e\n      \u003c/View\u003e\n    \u003c/DialogContent\u003e\n  \u003c/DialogComponent\u003e\n\u003c/View\u003e\n```\n\n## Props\n\n### DialogComponent\n| Prop | Type | Default | Note |\n|---|---|---|---|\n| `title` | `React Element` | | You can pass a `DialogTitle` component or pass a `View` for customizing titlebar |\n| `width` | `Number` | Your device width | The Width of Dialog, you can use fixed width or use percentage\n| `height` | `Number` | 300 | The Width of Dialog, you can use fixed height or use percentage\n| `dialogAnimation` |  | `FadeAnimation` | animation for dialog | |\n| `dialogStyle` | `Object` or `Number` | | | |\n| `animationDuration` | `Number` | `200` | | |\n| `overlayPointerEvents` | `String` | | Available option: `auto`, `none` |\n| `overlayBackgroundColor` | `String` | `#000` |\n| `overlayOpacity` | `Number` | `0.5` |\n| `dismissOnTouchOutside` | `Bool` | `true` | When touch overlay will close dialog, but if `haveOverlay` is false then the `dismissOnTouchOutside` won't work| |\n| `dismissOnHardwareBackPress` | `Bool` | `true` | Only for Android | |\n| `haveOverlay` | `Bool` | `true` | If false won't show overlay when dialog show | |\n| `show` | `Bool` | `false` |  | |\n| `onShown` | `Function` | | You can pass onShown function as a aallback function, will call the function while dialog shown | |\n| `onDismissed` | `Function` | | You can pass onDismissed function as a callback function, will call the function while dialog dismissed | |\n| `actions` | `Array` | | Array of `DialogButton` component for example: ```[\u003cDialogButton text=\"DISMISS\", align=\"center\" onPress={this.dismissDialog}/\u003e]``` | |\n\n\n### DialogContent\n| Prop | Type | Default | Note |\n|---|---|---|---|\n| `contentStyle` | | | Dialog's content container| |\n\n\n### DialogTitle\n| Prop | Type | Default | Note |\n|---|---|---|---|\n| `title` | `String` | | | |\n| `titleStyle` | `Object` or `Number` | | | |\n| `titleTextStyle` | `Object` or `Number` | | | |\n| `titleAlign` | `String` | `center` | | |\n| `haveTitleBar` | `Bool` | `true` | | |\n\n\n### DialogButton\n| Prop | Type | Default | Note |\n|---|---|---|---|\n| `text` | `String` | | | |\n| `align` | `String` | `center` | The position of the button. Available option: `left`, `center`, `right` | |\n| `onPress` | `Function` | | | |\n| `buttonStyle` | `Object` or `Number` | | | |\n| `textStyle` | `Object` or `Number` | | | |\n| `textContainerStyle` | `Object` or `Number` | | | |\n| `disabled` | `Boolean` | `false` | | |\n| `activeOpacity` | `Number` | | | |\n\n\n## Animation\n### Params for (*)Animation\n\n### FadeAnimation\n| Param | Type | Default | Note |\n|---|---|---|---|\n| `toValue` | Number | 0 | |\n| `animationDuration` | Number | 150 | |\n\n### ScaleAnimation\n| Param | Type | Default | Note |\n|---|---|---|---|\n| `toValue` | Number | 0 | |\n\n### SlideAnimation\n| Param | Type | Default | Note |\n|---|---|---|---|\n| `toValue` | Number | 0 | |\n| `slideFrom` | String | `bottom` | Available option: `top`, `bottom`, `left`, `right` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklam718%2Freact-native-dialog-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacklam718%2Freact-native-dialog-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklam718%2Freact-native-dialog-component/lists"}