{"id":19614307,"url":"https://github.com/fpapado/react-faux-button","last_synced_at":"2026-04-21T10:02:23.788Z","repository":{"id":57333254,"uuid":"140714109","full_name":"fpapado/react-faux-button","owner":"fpapado","description":"Accessible React \u003cbutton\u003e usurper.","archived":false,"fork":false,"pushed_at":"2018-07-25T13:51:41.000Z","size":67,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T15:04:55.521Z","etag":null,"topics":["a11y","accessibility","aria","button","preact","react"],"latest_commit_sha":null,"homepage":"","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/fpapado.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":"2018-07-12T13:04:20.000Z","updated_at":"2021-01-21T17:56:34.000Z","dependencies_parsed_at":"2022-08-24T21:01:54.131Z","dependency_job_id":null,"html_url":"https://github.com/fpapado/react-faux-button","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Freact-faux-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Freact-faux-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Freact-faux-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Freact-faux-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpapado","download_url":"https://codeload.github.com/fpapado/react-faux-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240906623,"owners_count":19876675,"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":["a11y","accessibility","aria","button","preact","react"],"created_at":"2024-11-11T10:51:00.837Z","updated_at":"2026-04-21T10:02:18.754Z","avatar_url":"https://github.com/fpapado.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Faux Button\n\n\u003e Accessible React `\u003cbutton\u003e` usurper.\n\n[![npm](https://img.shields.io/npm/v/react-faux-button.svg)](https://www.npmjs.com/package/react-faux-button)\n[![gzip size](http://img.badgesize.io/https://unpkg.com/react-faux-button/dist/react-faux-button.js?compression=gzip)](https://unpkg.com/react-faux-button/dist/react-faux-button.js)\n[![npm downloads](https://img.shields.io/npm/dm/react-faux-button.svg)](https://www.npmjs.com/package/react-faux-button)\n\n## Table of Contents\n\n* [Features](#features)\n* [Install](#install)\n* [Motivation](#motivation)\n* [Usage](#usage)\n\n## NOTE\nUse sparingly. If you can use the default `\u003cbutton\u003e` – possible more often than not – just do so.\nIncidentally, this is the reason the package is called \"faux\" button :)\n\n## Features\n\n* Accessible defaults.\n* Full presentational control for the caller.\n* Easy to understand source code. You should be able to fork and do your thing if desired.\n* Ample documentation to help you understand the problem, in addition to the solutions.\n\nWhat it does not do by itself:\n\n* Style things. That is up to you :)\n\n## Install\n\nThis package is distributed via [npm](https://www.npmjs.com/get-npm).\n\n```shell\n$ npm install --save react-faux-button\n# or\n$ yarn add react-faux-button\n```\n\nThen import according to your modules model and bundler, such as [Rollup](https://rollupjs.org/guide/en) and [Webpack](https://webpack.js.org/):\n\n```js\n// ES Modules\nimport { FauxButton } from \"react-faux-button\";\n\n/// CommonJS modules\nconst { FauxButton } = require(\"react-faux-button\");\n```\n\nA [UMD](https://github.com/umdjs/umd) version is also available on [unpkg](https://unpkg.com/):\n\n```html\n\u003cscript src=\"https://unpkg.com/react-faux-button/dist/react-faux-button.umd.js\"\u003e\u003c/script\u003e\n```\n\n## Motivation\nWhen having an interactable item in your application, a `button` is almost always the right answer.\nI have found that many developers are averse to using `button` due to its historical styling issues.\n\nWhile I find the button resets (and more importantly, styling) to be straightforward nowadays, I often have\nto work with codebases that use `div`s with an `onClick`. Those codebases might have non-straightforward\nresets, might rely on the element being a `div`, and so on. In those cases, I find it particularly useful\nto have an accessible `button` usurper. This is the one I use.\n\n## Usage\n### Quick Start\n\nIf you want to just dive in, do this:\n\n```jsx\nimport { FauxButton } from \"react-faux-button\";\n\n\u003cFauxButton tag=\"div\" onInteraction={() =\u003e /* do something */}\u003e\n  Print files\n\u003c/FauxButton\u003e\n```\n\n## References\nThe ARIA authoring practices offer a concise overview of expected button behaviour:\n- https://www.w3.org/TR/wai-aria-practices-1.1/#button\n- https://www.w3.org/TR/wai-aria-practices-1.1/examples/button/button.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Freact-faux-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpapado%2Freact-faux-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Freact-faux-button/lists"}