Gathering detailed insights and metrics for rc-mentions
Gathering detailed insights and metrics for rc-mentions
Gathering detailed insights and metrics for rc-mentions
Gathering detailed insights and metrics for rc-mentions
npm install rc-mentions
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
82 Stars
208 Commits
51 Forks
6 Watching
9 Branches
41 Contributors
Updated on 22 Nov 2024
Minified
Minified + Gzipped
TypeScript (95.45%)
Less (3.33%)
JavaScript (1.09%)
Shell (0.14%)
Cumulative downloads
Total Downloads
Last day
-2.4%
262,382
Compared to previous day
Last week
2.2%
1,464,758
Compared to previous week
Last month
7%
6,092,454
Compared to previous month
Last year
20.8%
62,578,223
Compared to previous year
1/** 2 * inline: true 3 */ 4import Mentions from 'rc-mentions'; 5// Import the default styles 6import './index.less'; 7 8const { Option } = Mentions; 9 10var Demo = ( 11 <Mentions> 12 <Option value="light">Light</Option> 13 <Option value="bamboo">Bamboo</Option> 14 <Option value="cat">Cat</Option> 15 </Mentions> 16); 17React.render(<Demo />, container);
Note: We use index.less for styling, you can convert them into css and properly reference them to the code above.
name | description | type | default |
---|---|---|---|
autoFocus | Auto get focus when component mounted | boolean | false |
defaultValue | Default value | string | - |
filterOption | Customize filter option logic | false | (input: string, option: OptionProps) => boolean | - |
notFoundContent | Set mentions content when not match | ReactNode | 'Not Found' |
placement | Set popup placement | 'top' | 'bottom' | 'bottom' |
direction | Set popup direction | 'ltr' | 'rtl' | 'ltr' |
prefix | Set trigger prefix keyword | string | string[] | '@' |
rows | Set row count | number | 1 |
split | Set split string before and after selected mention | string | ' ' |
silent | Used in transition phase, does not respond to keyboard enter events when equal to true | boolean | false |
validateSearch | Customize trigger search logic | (text: string, props: MentionsProps) => void | - |
value | Set value of mentions | string | - |
onChange | Trigger when value changed | (text: string) => void | - |
onKeyDown | Trigger when user hits a key | React.KeyboardEventHandler<HTMLTextAreaElement> | - |
onKeyUp | Trigger when user releases a key | React.KeyboardEventHandler<HTMLTextAreaElement> | - |
onSelect | Trigger when user select the option | (option: OptionProps, prefix: string) => void | - |
onSearch | Trigger when prefix hit | (text: string, prefix: string) => void | - |
onFocus | Trigger when mentions get focus | React.FocusEventHandler<HTMLTextAreaElement> | - |
onBlur | Trigger when mentions lose focus | React.FocusEventHandler<HTMLTextAreaElement> | - |
getPopupContainer | DOM Container for suggestions | () => HTMLElement | - |
autoSize | Textarea height autosize feature, can be set to true|false or an object { minRows: 2, maxRows: 6 } | boolean | object | - |
onPressEnter | The callback function that is triggered when Enter key is pressed | function(e) | - |
onResize | The callback function that is triggered when textarea resize | function({ width, height }) | - |
name | description |
---|---|
focus() | Component get focus |
blur() | Component lose focus |
npm install
npm start
online example: http://react-component.github.io/mentions/
npm test
npm run coverage
rc-mentions is released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 9/24 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
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
Reason
SAST tool is not run on all commits -- score normalized to 0
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