{"id":13830238,"url":"https://github.com/saharmor/react-super-cmd","last_synced_at":"2025-04-09T21:52:48.223Z","repository":{"id":57345914,"uuid":"319697742","full_name":"saharmor/react-super-cmd","owner":"saharmor","description":"A sleek command palette modal for React apps","archived":false,"fork":false,"pushed_at":"2023-11-09T00:36:27.000Z","size":2640,"stargazers_count":63,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T11:09:31.545Z","etag":null,"topics":["accessability","command-line","command-palette","navigation","react","reactjs","shortcuts","superhuman"],"latest_commit_sha":null,"homepage":"https://saharmor.github.io/react-super-cmd/","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/saharmor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"saharmor"}},"created_at":"2020-12-08T16:33:45.000Z","updated_at":"2025-02-10T11:47:27.000Z","dependencies_parsed_at":"2024-01-15T17:39:18.144Z","dependency_job_id":"cc2080c1-12c7-40c9-862e-8fb7b204971d","html_url":"https://github.com/saharmor/react-super-cmd","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"6e23b902609f80b11f5cca61dcd0e55c0ac8b089"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharmor%2Freact-super-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharmor%2Freact-super-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharmor%2Freact-super-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharmor%2Freact-super-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saharmor","download_url":"https://codeload.github.com/saharmor/react-super-cmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074977,"owners_count":21043490,"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":["accessability","command-line","command-palette","navigation","react","reactjs","shortcuts","superhuman"],"created_at":"2024-08-04T10:00:57.658Z","updated_at":"2025-04-09T21:52:48.197Z","avatar_url":"https://github.com/saharmor.png","language":"JavaScript","funding_links":["https://github.com/sponsors/saharmor"],"categories":["Libraries"],"sub_categories":["React"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"350px\" src=\"https://i.ibb.co/9rMgx60/demo-image.png\" alt=\"Commandline modal\"/\u003e\u003cbr/\u003e\n  \u003ch2 align=\"center\"\u003eReact Super Command ⚡\u003c/h2\u003e\n\u003c/p\u003e\n\n[![NPM](https://img.shields.io/npm/v/react-super-cmd.svg)](https://www.npmjs.com/package/react-super-cmd) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nThe command-line experience for the no-mouse generation. A blazing fast command line for your users to seamlessly interact with your React app.\n\u003cbr\u003e\u003cbr\u003e\n[Live demo](https://saharmor.github.io/react-super-cmd/)\n\n## Installation\n\n### npm\n\n```bash\nnpm install --save react-super-cmd\n```\n\n### yarn\n\n```bash\nyarn add react-super-cmd\n```\n\n## Usage\n\n```jsx\nimport React from 'react';\nimport CommandLineModal from \"react-super-cmd\";\n\nimport SearchOutlinedIcon from '@material-ui/icons/SearchOutlined';\nimport AddCircleOutlineIcon from '@material-ui/icons/AddCircleOutline';\nimport RemoveCircleOutlineOutlinedIcon from '@material-ui/icons/RemoveCircleOutlineOutlined';\nimport OfflineBoltOutlined from \"@material-ui/icons/OfflineBoltOutlined\";\n\n\nconst App = () =\u003e {\n  const [cmdLineModal, setCmdLineModal] = useState(true);\n\n  const commands = {\n    SEARCH_CONTACT: {\n      name: 'Search', logo: \u003cSearchOutlinedIcon/\u003e, shortcut: 'S', callback: () =\u003e console.log('search')\n    },\n    ADD_CONTACT: {\n      name: 'Add', logo: \u003cAddCircleOutlineIcon/\u003e, shortcut: '⌘ A', callback: () =\u003e console.log('add')\n    },\n  };\n\n  function toggleIsOpen() {\n    setCmdLineModal(previousState =\u003e !previousState);\n  };\n\n  return (\n    \u003cCommandLineModal commands={commands} \n                      isOpen={cmdLineModal} \n                      toggleIsModalOpen={toggleIsOpen}\n                      title={\"Super Command\"} \n                      logo={\u003cOfflineBoltOutlined/\u003e}\n                      noOptionsText = \"No commands found. Try a different search term.\"\n    /\u003e\n  );\n};\n\nexport default App;\n```\n\n## Props\n### commands\nObject representing the different commands to list. The key is command's name and value is another object containing command details. Example:\n```\nconst commands = {\n    SEARCH_CONTACT: {\n      name: 'Search', logo: \u003cSearchOutlinedIcon/\u003e, shortcut: 'S', callback: () =\u003e console.log('search')\n    },\n    ADD_CONTACT: {\n      name: 'Add', logo: \u003cAddCircleOutlineIcon/\u003e, shortcut: '⌘ A', callback: () =\u003e console.log('add')\n    },\n  };\n```\nCommand details varibales\n\n| Parameter  | Type      | Description | Example |\n| :--------- | :-------- | :---------- | :----- |\n| name       | `string`    | The text to be displayed for this command| Search \n| logo       | `component` | Component that will be next to command's name |`\u003cSearchOutlinedIcon/\u003e` from Material UI|\n| shortcut   | `string`    | Shortcut text to display next to command name |⌘ S|\n| callback   | `func`      | A function callback text to be displayed for this command|function searchCallback() {\u003cbr/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;console.log(\"search called\")\u003cbr/\u003e}|\n\n### isOpen\nIf true, command line modal will be visible.\n\n### toggleIsModalOpen\nA function to be called to toggle modal state. Used to control isOpen state within the external component (e.g. `Super Command` in above example). \n\n### title\nThe title to be displayed for the command line modal (e.g. `\u003cApp\u003e` in above example)\n\n### logo\nOptional\u003cbr\u003e\nA logo component to display as part of the title\n\n### noOptionsTest\nOptional\u003cbr\u003e \nText to show when no commands were found based on input search term\n\n## Development\nFollow create-react-library's [development guide](https://www.npmjs.com/package/create-react-library#development)\n\n## License\n`react-super-cmd` is released under MIT license © [saharmor](https://github.com/saharmor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharmor%2Freact-super-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaharmor%2Freact-super-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharmor%2Freact-super-cmd/lists"}