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
<script>
import Inspect from 'svelte-inspect';
$: examples = {
instructions: 'Try using the keyboard to navigate: arrows, tab/enter/escape/space, or type anything for fuzzy search.',
primitives: {
voids: [null, undefined],
bools: [true, false],
numbers: [0, 1E-20, NaN, -Infinity, Math.PI, typeof BigInt !== 'undefined' ? BigInt('1234567898765432123456789') : 'No BigInt for you 😢'],
string: 'Hello world! Supports escapes: \t\r\n',
symbols: [Symbol.iterator, Symbol.for('hope')]
},
objectsAndClasses: {
plain: {hen: 'dog', 'cow': 'cat'},
plainer: Object.assign(Object.create(null), {koi: 'ant'}),
plainest: Object.create(null),
class: Inspect,
'special props': Object.create(null, {
'getter': {get() {return Math.random();}, enumerable: true},
'throwing getter': {get() {throw new Error('The getter failed :(')}, enumerable: true},
'non enumerable': {value: 'test'}
}),
'more examples': [location, Math, JSON, document]
},
arrays: {
basic: ['fox', 'bat'],
Uint8Array: new Uint8Array([10, 20, 30, 40]),
Int32Array: new Int32Array([2, 2147, 2147483, 2147483647]),
BigInt64Array: typeof BigInt64Array !== 'undefined' && new BigInt64Array([3, 6, 8].map(BigInt))
},
functions: {
method() {},
arrow: v => v,
anotherArrow: (a = 1, b = 2, c = 3) => {},
oldschool: function oldschool(a, b, c) {},
native: alert,
},
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */