{"id":13495447,"url":"https://github.com/atomicpages/pretty-checkbox-react","last_synced_at":"2025-03-28T16:32:34.776Z","repository":{"id":37802861,"uuid":"165915265","full_name":"atomicpages/pretty-checkbox-react","owner":"atomicpages","description":"A tiny react/preact wrapper around pretty-checkbox","archived":false,"fork":false,"pushed_at":"2024-04-14T00:23:40.000Z","size":14561,"stargazers_count":35,"open_issues_count":16,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T10:15:37.010Z","etag":null,"topics":["animation","checkbox","css","hooks","html","icons","preact","radio-buttons","react","scss"],"latest_commit_sha":null,"homepage":"https://pretty-checkbox-react.netlify.app/","language":"TypeScript","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/atomicpages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2019-01-15T20:02:56.000Z","updated_at":"2024-04-20T01:30:39.361Z","dependencies_parsed_at":"2024-04-20T01:30:08.164Z","dependency_job_id":"6f46bcfd-9a40-46db-a179-158cfd6f8303","html_url":"https://github.com/atomicpages/pretty-checkbox-react","commit_stats":{"total_commits":205,"total_committers":6,"mean_commits":"34.166666666666664","dds":0.224390243902439,"last_synced_commit":"89428d7ec30d89cb038c4ec1dea95aa071568543"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicpages%2Fpretty-checkbox-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicpages%2Fpretty-checkbox-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicpages%2Fpretty-checkbox-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicpages%2Fpretty-checkbox-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicpages","download_url":"https://codeload.github.com/atomicpages/pretty-checkbox-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246062982,"owners_count":20717716,"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":["animation","checkbox","css","hooks","html","icons","preact","radio-buttons","react","scss"],"created_at":"2024-07-31T19:01:34.848Z","updated_at":"2025-03-28T16:32:34.260Z","avatar_url":"https://github.com/atomicpages.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch4 align=\"center\"\u003eA flexible, yet simple React API around Pretty Checkbox\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/atomicpages/pretty-checkbox-react/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/release/atomicpages/pretty-checkbox-react.svg?style=flat-square\u0026colorA=8033b0\u0026colorB=75b7dd\" alt=\"Github Release\"\u003e\n  \u003c/a\u003e\n   \u003ca href=\"https://github.com/atomicpages/pretty-checkbox-react/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/github/license/atomicpages/pretty-checkbox-react.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pretty-checkbox-react\" target=\"_blank\" rel=\"nofollow noreferred noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/pretty-checkbox-react.svg?style=flat-square\" alt=\"Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href='https://coveralls.io/github/atomicpages/pretty-checkbox-react?branch=master' target=\"_blank\" rel=\"nofollow noreferred noopener\"\u003e\n    \u003cimg alt=\"Coverage Status\" src=\"https://img.shields.io/coveralls/github/atomicpages/pretty-checkbox-react/master.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"preview.gif\" alt=\"Pretty checkbox preview\" /\u003e\n\u003c/div\u003e\n\n# Pretty Checkbox React\n\nPretty Checkbox React (PCR for short) is a small react wrapper around the the\npretty awesome library pretty checkbox.\n\n## Getting Started\n\n\u003e Pretty Checkbox React uses hooks heavily., Be sure you're running React 16.9\n\u003e or later :smile:. Not using hooks? No sweat \u0026ndash; you still need 16.9+! PCR\n\u003e is compatible with classes, too!\n\n```sh\nnpm i pretty-checkbox pretty-checkbox-react\n\n# or with yarn\nyarn add pretty-checkbox pretty-checkbox-react\n```\n\nMake sure you're on a supported version of React and React DOM:\n\n```sh\nnpm i react@^16.9 react-dom@^16.9\n\n# or use the latest and greatest react\nnpm i react react-dom\n```\n\n### Using Preact?\n\nPCR seamlessly integrates with Preact :sunglasses:, you don't even need to\ninclude `preact/compat`!\n\n## Basic Usage\n\nPCR components are easy to use and require no additional setup. Use as\ncontrolled or uncontrolled, use with hooks or with classes, and pass all the\nprops you want -- it's all forwarded to the underlying `input` element. Hungry\nfor more? Head on over the the\n[doc site](https://pretty-checkbox-react.netlify.app/).\n\n```tsx\nimport { Checkbox } from 'pretty-checkbox-react';\n\nfunction App() {\n  return \u003cCheckbox\u003eDo you agree to the terms and conditions?\u003c/Checkbox\u003e;\n}\n```\n\n### Uncontrolled Usage\n\nAdd a `ref` and get access to the input element. Uncontrolled mode allows for\nseamless integration with form solutions like `react-hook-form`:\n\n```tsx\nimport { useEffect, useRef } from 'react';\nimport { Checkbox } from 'pretty-checkbox-react';\n\nfunction App() {\n  const ref = useRef(null);\n\n  useEffect(() =\u003e {\n    if (ref.current) {\n      // do something awesome\n    }\n  }, []);\n\n  return (\n    \u003cCheckbox ref={ref}\u003eDo you agree to the terms and conditions?\u003c/Checkbox\u003e\n  );\n}\n```\n\n### Controlled Mode\n\nUse our awesome hooks to abstract away state logic!\n\n```tsx\nimport { useCallback } from 'react';\nimport { Checkbox, useCheckboxState } from 'pretty-checkbox-react';\n\nfunction App() {\n  const checkbox = useCheckboxState();\n\n  const onSubmit = useCallback(\n    (e) =\u003e {\n      e.preventDefault();\n\n      if (!checkbox.state) {\n        // update the state manually from the `confirm` result\n        checkbox.setState(confirm('Do you agree to the terms and conditions?'));\n      }\n    },\n    [checkbox]\n  );\n\n  return (\n    \u003cform onSubmit={onSubmit}\u003e\n      \u003cCheckbox name=\"tac\" value=\"\" {...checkbox}\u003e\n        Do you agree to the terms and conditions?\n      \u003c/Checkbox\u003e\n    \u003c/form\u003e\n  );\n}\n```\n\n## Documentation\n\nPCR has extensive docs documented here:\nhttps://pretty-checkbox-react.netlify.app/. Give it a read and see what PCR is\nall about :+1:.\n\n### Legacy Docs\n\nFor posterity purposes, PCR 1.x docs are still hosted here:\nhttps://atomicpages.github.io/pretty-checkbox-react/home/\n\n## Changelog\n\nHead on over to\n[releases](https://github.com/atomicpages/pretty-checkbox-react/releases) :tada:\n\n## Contributions\n\nShout out to [Lokesh](https://github.com/lokesh-coder) for creating the original\n[pretty-checkbox library](https://github.com/lokesh-coder/pretty-checkbox)\n:star:\n\n## License\n\nThis project is licensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicpages%2Fpretty-checkbox-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicpages%2Fpretty-checkbox-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicpages%2Fpretty-checkbox-react/lists"}