Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
@foundationui/smart-input
Advanced tools
Smart input/textarea component for React. Learns to provide inline, tab-completeable suggestions.
<SmartInput>
Drop-in <input>
and <textarea>
replacement that that provides inline, tab-completable suggestions similar to GitHub Copilot.
The component automatically learns user inputs and makes better suggestions over time. We don't call it smart for nothing!
import { SmartInput } from '@lydian-company/smart-input'
function MySmartInput() {
const [value, setValue] = useState('')
return (
<SmartInput
modelId="<add yours here>"
placeholder="Type something..."
renderText={props => <span {...props} />}
renderCompletion={props => <span style={{ opacity: 0.4 }} {...props} />}
value={value}
onChange={setValue}
multiline={false}
/>
)
}
Check out more examples or try the online editor.
npm install --save @lydian-company/smart-input
yarn add @lydian-company/smart-input
modelId: String
The identifier of your model. Can be shared across different inputs, or unique per input.
value: String
The controlled text value of the content.
onChange: Function
Arguments: newValue: String
Invoked whenever the text value of the content changes. Use this to update the value for the controlled component.
renderText: Function
Arguments: props: Any
Invoked to display normal text, returns a JSX.Element. You should use an inline element and splat props, like so:
renderText={props => <span {...props} />}
renderCompletion: Function
Arguments: props: Any
Invoked to display completion text, returns a JSX.Element. You should use an inline element and splat props, like so:
renderSuggestion={props => <span {...props} />}
multiline: Boolean
(optional)Default value: undefined
Whether or not to allow multiline text.
placeholder: String
(optional)The text to display when value is empty.
FAQs
Smart input/textarea component for React. Learns to provide inline, tab-completeable suggestions.
The npm package @foundationui/smart-input receives a total of 37 weekly downloads. As such, @foundationui/smart-input popularity was classified as not popular.
We found that @foundationui/smart-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.