{"id":26462094,"url":"https://github.com/kerematam/rc-spotlight","last_synced_at":"2025-03-19T05:44:54.462Z","repository":{"id":124207326,"uuid":"229596795","full_name":"kerematam/rc-spotlight","owner":"kerematam","description":"It's a component to highlight wrapped component(s) by filling background with backdrop layer.","archived":false,"fork":false,"pushed_at":"2024-04-23T01:42:50.000Z","size":778,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T12:58:19.591Z","etag":null,"topics":["backdrop","highlight","reactjs","spotlight"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/kerematam.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-12-22T16:27:00.000Z","updated_at":"2023-08-18T13:25:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"df5ccd8e-dabb-4b15-8249-843cc159dbe6","html_url":"https://github.com/kerematam/rc-spotlight","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.036363636363636376","last_synced_commit":"caf8038343a4381f965e798a8b907e80c9aa4c07"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerematam%2Frc-spotlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerematam%2Frc-spotlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerematam%2Frc-spotlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerematam%2Frc-spotlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerematam","download_url":"https://codeload.github.com/kerematam/rc-spotlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244227395,"owners_count":20419237,"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":["backdrop","highlight","reactjs","spotlight"],"created_at":"2025-03-19T05:44:53.768Z","updated_at":"2025-03-19T05:44:54.452Z","avatar_url":"https://github.com/kerematam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rc-spotlight\n\n\u003e Spotlight component simply highlights the component(s) that it wraps.\n\n[![NPM](https://img.shields.io/npm/v/rc-spotlight.svg)](https://www.npmjs.com/package/rc-spotlight)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\n# Install\n\n```bash\nnpm install --save rc-spotlight\n```\n\n# Demo \n\n[![Edit react-counter-input](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-spotlight-example-zsi2j)\n\n![Image description](docs/images/showcase.gif)\n\n# Usage\n\n```jsx\nimport React, { Component } from \"react\";\nimport Spotlight from \"rc-spotlight\";\n\nclass Example extends Component {\n  render() {\n    return (\n      \u003cSpotlight isActive label={\u003ch1\u003eThis is backdrop view\u003c/h1\u003e}\u003e\n        \u003cdiv\u003eContent with Spotlight Effect\u003c/div\u003e\n      \u003c/Spotlight\u003e\n    );\n  }\n}\n```\n\n## Usage with LabelWrapper\n\n```jsx\nimport React from \"react\";\nimport Spotlight, { LabelWrapper } from \"rc-spotlight\";\n\nconst BackdropText = text =\u003e (\n  \u003cLabelWrapper center\u003e\n    \u003cdiv\u003e{text}\u003c/div\u003e\n  \u003c/LabelWrapper\u003e\n);\n\nconst App = () =\u003e (\n  \u003cSpotlight isActive label={BackdropText(\"This is title\")}\u003e\n    \u003ch1\u003eSpotlight\u003c/h1\u003e\n  \u003c/Spotlight\u003e\n);\n```\n\n## Usage with Antd Tooltip\n\n![Image description](docs/images/showcase_antd.gif)\n\nCreate Wrapper for Spotlight with Tooltip :\n\n```jsx\nconst SpotlightWithTooltip = ({\n  isActive,\n  toolTipPlacement = \"top\",\n  toolTipTitle = \"Check here!\",\n  children,\n  ...rest\n}) =\u003e {\n  return (\n    \u003cTooltip\n      placement={toolTipPlacement}\n      visible={isActive}\n      title={toolTipTitle}\n    \u003e\n      \u003cSpotlight isActive={isActive} {...rest}\u003e\n        {children}\n      \u003c/Spotlight\u003e\n    \u003c/Tooltip\u003e\n  );\n};\n```\n\nAnd use it :\n\n```jsx\nconst App = () =\u003e (\n  \u003cSpotlightWithTooltip\n    isActive\n    toolTipPlacement=\"right\"\n    toolTipTitle={\"You can use Antd Tooltip\"}\n    style={{\n      width: \"fit-content\",\n      boxShadow: \"0 0 0 5px #ffffff\"\n    }}\n  \u003e\n    \u003cTitle\u003eSpotlight\u003c/Title\u003e\n  \u003c/SpotlightWithTooltip\u003e\n);\n```\n\n## Spotlight API\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eProperty\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDefault\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eisActive\u003c/td\u003e\n      \u003ctd\u003eWhether the component is enabled or disabled.\u003c/td\u003e\n      \u003ctd\u003eBoolean\u003c/td\u003e\n      \u003ctd\u003efalse\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003echildren\u003c/td\u003e\n      \u003ctd\u003eComponent(s) to have spotlight effect.\u003c/td\u003e\n      \u003ctd\u003eNode(s)\u003c/td\u003e\n      \u003ctd\u003enull\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003elabel\u003c/td\u003e\n      \u003ctd\u003eComponent(s) to be rendered over backdrop.\u003c/td\u003e\n      \u003ctd\u003eNode(s)\u003c/td\u003e\n      \u003ctd\u003enull\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ezIndex\u003c/td\u003e\n      \u003ctd\u003eZ index of backdrop and wrapped component.\u003c/td\u003e\n      \u003ctd\u003eNumber or String\u003c/td\u003e\n      \u003ctd\u003e1000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ebackdropColor\u003c/td\u003e\n      \u003ctd\u003eColor of backdrop.\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003e#000000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ebackdropOpacity\u003c/td\u003e\n      \u003ctd\u003eOpacity of backdrop.\u003c/td\u003e\n      \u003ctd\u003eNumber\u003c/td\u003e\n      \u003ctd\u003e0.8\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003einheritParentBackgroundColor\u003c/td\u003e\n      \u003ctd\u003eRecursively search for parent background color in case you don't want your component to inherit color of\n        backdrop. This prop prevent transparent component to inherit backdrop color.\u003c/td\u003e\n      \u003ctd\u003eBoolean\u003c/td\u003e\n      \u003ctd\u003etrue\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eenableShadow\u003c/td\u003e\n      \u003ctd\u003eGives shadow around wrapped component .\u003c/td\u003e\n      \u003ctd\u003eBoolean\u003c/td\u003e\n      \u003ctd\u003efalse\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003estyle\u003c/td\u003e\n      \u003ctd\u003eInline style for wrapped component when spotlight is actived\u003c/td\u003e\n      \u003ctd\u003eObject\u003c/td\u003e\n      \u003ctd\u003enull\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## LabelWrapper API\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr \u003e\n      \u003cth\u003eProperty\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDefault\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003echildren\u003c/td\u003e\n      \u003ctd\u003eComponent(s) to have spotlight effect.\u003c/td\u003e\n      \u003ctd\u003eNode(s)\u003c/td\u003e\n      \u003ctd\u003enull\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ezIndex\u003c/td\u003e\n      \u003ctd\u003eZ index of backdrop and wrapped component.\u003c/td\u003e\n      \u003ctd\u003eNumber or String\u003c/td\u003e\n      \u003ctd\u003e1000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ecenter\u003c/td\u003e\n      \u003ctd\u003eCenters label\u003c/td\u003e\n      \u003ctd\u003eBoolean\u003c/td\u003e\n      \u003ctd\u003efalse\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003estyle\u003c/td\u003e\n      \u003ctd\u003eInline style for label\u003c/td\u003e\n      \u003ctd\u003eObject\u003c/td\u003e\n      \u003ctd\u003enull\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## License\n\nMIT © [kerematam](https://github.com/kerematam)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerematam%2Frc-spotlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerematam%2Frc-spotlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerematam%2Frc-spotlight/lists"}