A React component to open files directly in VSCode, enhancing developer productivity by providing quick access to file editing.
- Open specified files directly in VSCode.
- Development-only feature to avoid cluttering the production UI.
- Customizable link text and styles.
To install the package, use npm:
npm install react-edit-file-link
Or with yarn:
yarn add react-edit-file-link
import React from 'react';
import { EditFileLink } from 'react-edit-file-link';
function App() {
return (
<div>
<h1>Test EditFileLink Component</h1>
<EditFileLink file={import.meta.url} name="App" />
</div>
);
}
export default App;
The EditFileLink
component accepts the following props:
file
(string, required): The path of the file to open in VSCode.name
(string, optional): The name to display in the link text. If not provided, defaults to "Open in VSCode".className
(string, optional): Additional CSS classes to style the link. Defaults to"text-blue-600 py-2"
.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request with your improvements.
If you wanna have coffee you can support here.