{"id":19889720,"url":"https://github.com/tinalabs/react-tinacms-prompts","last_synced_at":"2025-08-13T11:47:37.228Z","repository":{"id":57166648,"uuid":"287339574","full_name":"tinalabs/react-tinacms-prompts","owner":"tinalabs","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-31T16:17:11.000Z","size":517,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T19:24:28.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/tinalabs.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}},"created_at":"2020-08-13T17:22:01.000Z","updated_at":"2020-08-31T16:13:32.000Z","dependencies_parsed_at":"2022-08-30T15:21:32.374Z","dependency_job_id":null,"html_url":"https://github.com/tinalabs/react-tinacms-prompts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tinalabs/react-tinacms-prompts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinalabs%2Freact-tinacms-prompts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinalabs%2Freact-tinacms-prompts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinalabs%2Freact-tinacms-prompts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinalabs%2Freact-tinacms-prompts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinalabs","download_url":"https://codeload.github.com/tinalabs/react-tinacms-prompts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinalabs%2Freact-tinacms-prompts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269502567,"owners_count":24427790,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T18:11:28.813Z","updated_at":"2025-08-13T11:47:37.160Z","avatar_url":"https://github.com/tinalabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-tinacms-prompts\n\nThis package allows one to add prompts to pop to when the cms is enabled (edit mode) amd a condition is met.\n\n### Getting started\n\n\u003e NOTE: this is a plugin for tinacms and assumes that you are familiar with tinacms. If you are not [check it out](https://tinacms.org)\n\n### Install the package\n\n```bash\nyarn add @tinalabs/react-tinacms-prompts\n```\n\n### Wrap your app in a provider\n\n```jsx\n\u003cTinaProvider cms={this.cms}\u003e\n  \u003cPromptProvider\u003e\n    \u003cApp {...props} /\u003e\n  \u003c/PromptProvider\u003e\n\u003c/TinaProvider\u003e\n```\n\n### Prompts plugin interface\n\n```ts\nexport interface PromptPlugin\u003cComponentProps = Record\u003cstring, any\u003e\u003e {\n  __type: 'prompt'\n  name: string\n  Component(props: ComponentProps): React.ReactElement\n  condition: boolean\n  props?: ComponentProps\n}\n```\n\n| key       | usage                                                           |\n| --------- | --------------------------------------------------------------- |\n| \\_\\_type  | always `prompt`                                                 |\n| name      | the name or id you want to give to your prompt                  |\n| Component | The react component that is rendered when the condition is true |\n| condition | if this condition is true the Component will be rendered        |\n| props     | the props that are passed to the component                      |\n\n### Registering the plugin in your app\n\n```ts\nimport { useCMS } from 'tinacms'\n\nconst cms = useCMS()\nconst isNewUser = ...\n\ncms.plugins.add\u003cPromptPlugin\u003cMyProps\u003e\u003e({\n  __type: 'prompt',\n  Component: MyComponent,\n  name: 'hello-prompt',\n  condition: isNewUser,\n  props: {},\n})\n\n```\n\nNow when `isNewUser` is `true` and the cms is enabled a `MyComponent` will be registered\n\n\u003e Note: this is only one way to register a plugin [check out the tinacms docs for the full list](https://tinacms.org/docs/plugins)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinalabs%2Freact-tinacms-prompts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinalabs%2Freact-tinacms-prompts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinalabs%2Freact-tinacms-prompts/lists"}