Gathering detailed insights and metrics for rc-anchor
Gathering detailed insights and metrics for rc-anchor
npm install rc-anchor
Typescript
Module System
Node Version
NPM Version
73.3
Supply Chain
99.4
Quality
75.9
Maintenance
100
Vulnerability
100
License
HTML (58.58%)
JavaScript (30.97%)
CSS (10.45%)
Total Downloads
5,308
Last Day
18
Last Week
23
Last Month
66
Last Year
394
13 Stars
29 Commits
1 Forks
4 Watching
3 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.8
Package Id
rc-anchor@2.0.8
Unpacked Size
182.71 kB
Size
29.78 kB
File Count
22
NPM Version
5.7.1
Node Version
9.8.0
Cumulative downloads
Total Downloads
Last day
0%
18
Compared to previous day
Last week
21.1%
23
Compared to previous week
Last month
144.4%
66
Compared to previous month
Last year
-19.6%
394
Compared to previous year
English | 简体中文
This is a react anchor component (scroll cursor) that can be embedded multiple times on the same page, independent of each other, providing horizontal and vertical layout, css style fully customizable
npm install rc-anchor --save-dev
mport React from 'react'
import { Anchor } from 'rc-anchor'
class App extends React.Component {
constructor(props) {
super(props)
}
handleClickTitle(node) {
// console.log('node>>>', node)
}
render() {
const titleList = [
{ itemId: '1', name: 'item1' },
{ itemId: '2', name: 'item2' },
{ itemId: '3', name: 'item3' },
{ itemId: '4', name: 'item4' }
]
const generateBodyItem = titleList.map((item, index) => {
if (item) {
return <div key={index} data-item-id={item.itemId} className='my-body-item'>{item.name}</div>
}
})
return (
<div style={{ width: 300, Height: 400, marginTop: 50, marginLeft: 200 }}>
<Anchor titleList={titleList}
className='my-rc-anchor' headerClassName='my-rc-anchor-header'
titleClassName='my-rc-title-item' bodyClassName='my-rc-anchor-body'
onClick={this.handleClickTitle.bind(this)}
>
{generateBodyItem}
</Anchor>
</div>
)
}
}
css
.my-rc-anchor {
padding: 5px;
border: 1px solid #e4e4e4;
}
.my-rc-anchor .my-rc-anchor-header {
padding: 5px 0px;
}
.my-rc-anchor .my-rc-title-item {
margin-right: 10px;
padding: 2px 3px;
}
.my-rc-anchor .rc-title-item-active {
background-color: blue;
color: white;
}
.my-rc-anchor .my-rc-anchor-body {
border-top: 1px solid #e4e4e4;
}
.my-rc-anchor .my-body-item {
height: 200px;
padding: 5px;
}
.my-rc-anchor .my-body-item:nth-child(odd) {
background-color: green
}
.my-rc-anchor .my-body-item:nth-child(even) {
background-color: red
}
mport React from 'react'
import { Anchor } from 'rc-anchor'
class App extends React.Component {
constructor(props) {
super(props)
}
handleClickTitle(node) {
console.log('node>>>', node)
}
render() {
const titleList = [
{ itemId: '1', name: 'item1' },
{ itemId: '2', name: 'item2' },
{ itemId: '3', name: 'item3' },
{ itemId: '4', name: 'item4' }
]
const generateBodyItem = titleList.map((item, index) => {
if (item) {
return <div key={index} data-item-id={item.itemId} className='my-body-item'>{item.name}</div>
}
})
return (
<div style={{ width: 300, Height: 400, marginTop: 50, marginLeft: 200 }}>
<Anchor titleList={titleList}
className='my-rc-anchor' headerClassName='my-rc-anchor-header2'
titleClassName='my-rc-title-item' bodyClassName='my-rc-anchor-body'
onClick={this.handleClickTitle.bind(this)}
headDirection='col'
>
{generateBodyItem}
</Anchor>
</div>
)
}
}
css
.my-rc-anchor {
padding: 5px;
border: 1px solid #e4e4e4;
}
.my-rc-anchor .my-rc-anchor-header2 {
position: relative;
float: right;
}
.my-rc-anchor .my-rc-title-item {
padding: 2px 3px;
}
.my-rc-anchor .rc-title-item-active {
background-color: blue;
color: white;
}
.my-rc-anchor .my-rc-anchor-body {
border-top: 1px solid #e4e4e4;
}
.my-rc-anchor .my-body-item {
height: 200px;
padding: 5px;
}
.my-rc-anchor .my-body-item:nth-child(odd) {
background-color: green
}
.my-rc-anchor .my-body-item:nth-child(even) {
background-color: red
}
props | description | type | default | isRequired |
---|---|---|---|---|
titleList | The header displays an array of names, and the array object must contain two properties.{itemId, name} | array | Y | |
headDirection | the header direction, horizontal or vertical | enum ('row', 'col') | 'row' | N |
bodyHeightRealTime | whether the maximum height of the component body is acquired in real time, only valid when headDirection='row | bool | false | N |
bounds | the Anchor area boundary | number | 5(px) | N |
onClick | click on the head name callback function | function | (e)=>{} | N |
className | the className of the component | string | '' | N |
headerClassName | the className of the component header | string | '' | N |
titleClassName | the className of the component headerTitle,the className of active headerTitle is 'rc-title-item-active' | string | '' | N |
bodyClassName | the className of the component body | string | '' | N |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
119 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More