Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Circle.svelte
<script>
import Circle from './Circle.svelte';
</script>

<!-- this works fine with no style props -->
<svg viewbox='0 0 300 300'>
<Circle />
</svg>

<!-- adding a style prop adds a <div> inside the svg
and breaks rendering of the Circle -->
<svg viewbox='0 0 300 300'>
<Circle --circle-fill="blue" />
</svg>

<style>
svg {
border:1px solid black;
width: 300px;
}
</style>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */