https://github.com/egoist/svelte-convert
Convert Svelte component to Vue or React component, with SSR support.
https://github.com/egoist/svelte-convert
but-anyways maybe-naive
Last synced: 8 months ago
JSON representation
Convert Svelte component to Vue or React component, with SSR support.
- Host: GitHub
- URL: https://github.com/egoist/svelte-convert
- Owner: egoist
- License: mit
- Created: 2020-04-25T11:08:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:23:39.000Z (about 3 years ago)
- Last Synced: 2025-04-16T04:19:18.319Z (11 months ago)
- Topics: but-anyways, maybe-naive
- Language: TypeScript
- Homepage:
- Size: 886 KB
- Stars: 81
- Watchers: 3
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - svelte-convert
- awesome-list - svelte-convert
README
# Svelte-Convert
Convert Svelte component to Vue or React component, with SSR support.
## Why
[Svelte](https://svelte.dev) outputs light-weight JavaScript code, so you can use it to write framework agnostic component and then consume it in your React / Vue app.
## Install
```bash
yarn add svelte-convert
```
## Usage
### React
```jsx
import { convert } from 'svelte-convert/react'
import SvelteCounter from './Counter.svelte'
// Convert the Svelte component to React Component
const Counter = convert(SvelteCounter)
export default () => {
return
}
```
### Vue
```vue
import { convert } from 'svelte-convert/vue'
import SvelteCounter from './Counter.svelte'
export default {
components: {
Counter: convert(SvelteCounter)
}
}
```
## Related
You might also like:
- [React to Vue](https://github.com/egoist/react-to-vue)
- [Vue to React](https://github.com/egoist/vue-to-react)
## License
MIT © [EGOIST (Kevin Titor)](https://github.com/sponsors/egoist)