Category "svelte"

Component not centering when screen is smaller

I am making a website which has to be compatible for all devices (laptop, tablet, phone) and can't seem to get my weather API component to become smaller when o

In SvelteKit, is there a way to cancel a popstate event if user state isn't saved?

I have a component that allows a user to edit their state. This triggers a notSaved variable. I have a beforeunload event handler to handle reload and exiting t

Passing action to a component optionally

I've learnt that it's possible to pass action to a component: https://stackoverflow.com/a/66142037/15943057. Now I wonder if it would be possible to pass one op

How to launch a sveltekit app on Plesk (Phusion Passenger)?

I have built an app with SvelteKit and @sveltejs/adapter-node and deployed it to a server managed with Plesk via Git. I have activated and configured the node.j

How do get query string parameter in sveltekit?

I'm trying to the /login?ref=/some/path parameter to redirect to after login: const ref = $page.url.searchParams.get('ref') || '/dashboard'; However I get

Slow button response time with Capacitor x Svelte on Ios

I try to create a starter app with Capacitor and Svelte. Everything works fine except one thing, when I use native html anchor ( with svelte-routing) for naviga

NodeJs - Get last modified file in sub directories of directory

I have the following code to list all folders within a directory, and it maps each folder's name and date created. I'm struggling to get the last modified file

How to setup turborepo with sveltekit and pnpm

I am trying to add Turborepo to my Svelte apps but looks like the npx create-turbo@latest command and also the examples currently only support NextJs. How can I

How do you use element attributes with Svelte when compiling to a custom element?

I am trying to create a custom checkbox using Svelte and compile it to a custom element (with customElement: true) but I don't know what way is the proper way o

Svelte Gantt Chart - Separate via months

I'm trying to have a gantt chart with all 12 months in it. I'm doing this by setting the from & to values to currentDate.clone().endOf('year') & current

scroll to a overflowing item inside flex box

My desired goal is that when I keyboard to the right outside of the flexbox, I want to push the other items to the left so I can see the terms in the overflow,

Svelte - event modifier "once" on form submit not working

Any idea why the once modifier doesn't work on form submitting in Svelte? In the following example: <form action="./" on:submit|preventDefault|once={() =>

Sveltekit Base URL for subdirectory throws 404

I need a bit of understanding for serving a Sveltekit app from a subdirectory. My company will serve the app from a subdirectory called /activ. I figure it's ea

how to authenticate with svelte and jwt

how to authenticate with svelte and jwt how to use jwt with svelte I can't find an example of authentication using only svelte and jwt, no external providers. i

Svelte/SvelteKit - Update iframed component when props change

In my sveltekit app, i have an embedded application via iframes, and when the user goes to the url it essentially loads that relative url within the iframe (for

how to use tailwinds @apply with @layer directive from a Svelte component

I want to use apply to define some css setting on a component, and I also want to be able to overwrite it, like this: <!-- CustomButton.svelte --> <scr

Sevltekit 404 error when refreshing dynamic route

I want a static page that loads content dynamically based on URL, for example like this: https://example.com/pokemon/id It can load on the server or on the clie

Is there a 404 errorcode fallback page for svelte-routing?

This fallback component={NotFound} is the only way i found for error pages but returns a component page with server code 200, i'd like to get code 404. Is there

How to display a package.json version in the footer of the site?

I would like to display a version that is declared in the package.json file in the footer of my site How can I do this? I found this FAQ explanation in their do

near-api-js Failing to connect to near

Was making a svelte implementation of a near app. We have a button that connects to the testnet network. It will open wallet to sign in. When successful, it wil