Gathering detailed insights and metrics for rc-trigger
Gathering detailed insights and metrics for rc-trigger
Gathering detailed insights and metrics for rc-trigger
Gathering detailed insights and metrics for rc-trigger
npm install rc-trigger
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
367 Stars
535 Commits
225 Forks
9 Watching
19 Branches
56 Contributors
Updated on 08 Nov 2024
Minified
Minified + Gzipped
TypeScript (66.86%)
JavaScript (31.33%)
Less (1.81%)
Cumulative downloads
Total Downloads
Last day
-5.4%
237,619
Compared to previous day
Last week
1.7%
1,341,200
Compared to previous week
Last month
3.6%
5,690,741
Compared to previous month
Last year
-24.4%
69,941,867
Compared to previous year
5
React Trigger Component
Include the default styling and then:
1import React from 'react'; 2import ReactDOM from 'react-dom'; 3import Trigger from '@rc-component/trigger'; 4 5ReactDOM.render( 6 <Trigger 7 action={['click']} 8 popup={<span>popup</span>} 9 popupAlign={{ 10 points: ['tl', 'bl'], 11 offset: [0, 3], 12 }} 13 > 14 <a href="#">hover</a> 15 </Trigger>, 16 container, 17);
IE / Edge | Firefox | Chrome | Safari | Electron |
---|---|---|---|---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
npm install
npm start
name | type | default | description |
---|---|---|---|
alignPoint | bool | false | Popup will align with mouse position (support action of 'click', 'hover' and 'contextMenu') |
popupClassName | string | additional className added to popup | |
forceRender | boolean | false | whether render popup before first show |
destroyPopupOnHide | boolean | false | whether destroy popup when hide |
getPopupClassNameFromAlign | getPopupClassNameFromAlign(align: Object):String | additional className added to popup according to align | |
action | string[] | ['hover'] | which actions cause popup shown. enum of 'hover','click','focus','contextMenu' |
mouseEnterDelay | number | 0 | delay time to show when mouse enter. unit: s. |
mouseLeaveDelay | number | 0.1 | delay time to hide when mouse leave. unit: s. |
popupStyle | Object | additional style of popup | |
prefixCls | String | rc-trigger-popup | prefix class name |
popupTransitionName | String|Object | https://github.com/react-component/animate | |
maskTransitionName | String|Object | https://github.com/react-component/animate | |
onPopupVisibleChange | Function | call when popup visible is changed | |
mask | boolean | false | whether to support mask |
maskClosable | boolean | true | whether to support click mask to hide |
popupVisible | boolean | whether popup is visible | |
zIndex | number | popup's zIndex | |
defaultPopupVisible | boolean | whether popup is visible initially | |
popupAlign | Object: alignConfig of [dom-align](https://github.com/yiminghe/dom-align) | popup 's align config | |
onPopupAlign | function(popupDomNode, align) | callback when popup node is aligned | |
popup | React.Element | function() => React.Element | popup content | |
getPopupContainer | getPopupContainer(): HTMLElement | function returning html node which will act as popup container | |
getDocument | getDocument(): HTMLElement | function returning document node which will be attached click event to close trigger | |
popupPlacement | string | use preset popup align config from builtinPlacements, can be merged by popupAlign prop | |
builtinPlacements | object | builtin placement align map. used by placement prop | |
stretch | string | Let popup div stretch with trigger element. enums of 'width', 'minWidth', 'height', 'minHeight'. (You can also mixed with 'height minWidth') |
npm test
npm run coverage
open coverage/ dir
rc-trigger is released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
17 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-18
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