Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
90 views

I have component <Component> which is basically an instance of another component <Modal> (a modal used for a specific action). For consistency and improved legibility I am passing all the ...
Moon Rat's user avatar
0 votes
1 answer
77 views

I am using SvelteKit and I have a component that displays a CSS background-image - see picture. I have this working with a hard-coded image but I need to vary the image from card to card. Here is my ...
Zax71's user avatar
  • 38
0 votes
1 answer
101 views

I’m using a custom Select component inside a table, and I want to make some reactive calculations in the parent component for example, updating the total price when a discount is selected through a ...
Juan Jose Rios's user avatar
0 votes
1 answer
154 views

I have a derived variable from a property of a svelte component: let {entity = $bindable(), targetType}: { entity: EntityDTO, targetType: EntityType } = $props(); const links = $derived(entity.links?....
Zied Hamdi's user avatar
  • 2,692
1 vote
0 answers
133 views

Not able to get routing to work without a bug. The route works if I click on the link twice, the second time, the correct page renders. The first a console output error is generated. ERROR: Uncaught ...
Bill's user avatar
  • 1,235
0 votes
1 answer
44 views

Svelte action that does things when keys are pressed: import type { Action } from "svelte/action" export const keys: Action<HTMLElement, boolean> = (node, active?: boolean) => { ...
Alex's user avatar
  • 66.6k
0 votes
1 answer
97 views

I am using svelte to build a chrome extension which has the ability to upload images and Post that image to instagram. Here is my project directory structure. ├── .git/ ├── .gitignore ├── .npmrc ├── ...
Danish Xavier's user avatar
0 votes
1 answer
61 views

I am migrating my codebase from Svelte 4 to Svelte 5. I had the following code: import MarkdownLinkRenderer from '$lib/MarkdownLinkRenderer.svelte'; export function createMarkdownLinkRenderer(styles: ...
AlexAngc's user avatar
  • 422
0 votes
1 answer
81 views

Component.svelte: <script> export function test(){ return "test"; } </script> App.svelte: <script> import { test } from "./Component.svelte" // error; ...
Alex's user avatar
  • 66.6k
0 votes
2 answers
580 views

Parent component: <script> import Child from "./Child.svelte" import { onMount } from "svelte"; import apireq from "./api.js"; let items = $...
Alex's user avatar
  • 66.6k
2 votes
2 answers
2k views

New to SvelteKit and trying to figure this part out... Here's a couple of ways I was trying to achieve this, but the sidebar either doesn't load, or the navigation appears twice for some reason; with ...
Brad T's user avatar
  • 45
0 votes
0 answers
56 views

Hi im trying to import a svelte component from another svelte.ts app. This component has a script: button.svelte: <script lang="ts"> import { cn } from "$lib/utils.js"; ...
MOFRA's user avatar
  • 3
0 votes
1 answer
168 views

I have a component written in Svelte 5, using $props() rune. LogActions.svelte <script lang="ts"> //@ts-expect-error let { onSave }: { (): void } = $props() ; </script> <...
Jindrich Vavruska's user avatar
0 votes
0 answers
42 views

Sending information to specific groups is not working For a school project is was trying to send data to my frontend im working on. However when i try to do that i receive notting. When i change from ...
NBoonman's user avatar
1 vote
1 answer
369 views

In Svelte 5, how can I wrap each child with a tag like the example below? {#if children} {#each children as child} <button onclick={() => { handleClick(); }} > ...
Baboyiban's user avatar
0 votes
1 answer
145 views

In shadcn ui port for svelte 5 - Select component (using bitsui select) bind:value asks for state(string), but Writable<string> works too as well, so bind:value={$theme or $language} is properly ...
Mapagmataas's user avatar
0 votes
1 answer
1k views

I'm following the tutorial provided by the Svelte team in their website! There is this section in the tutorial that basically explains how we can expose certain functionalities from a custom component:...
A . R . B's user avatar
2 votes
2 answers
5k views

I'm currently upgrading from Svelte 4 to Svelte 5 (using SvelteKit), and I'm encountering an issue when trying to replace the deprecated <slot /> with {@render} in my components. I'm looping ...
Thomaszter's user avatar
  • 1,484
0 votes
1 answer
599 views

I'm making a site using Svelte and SvelteKit, and I'd like to use a predefined array of colors for styling in a normalized way-- if I change one of the values later, everywhere that styles using that ...
food's user avatar
  • 27
0 votes
1 answer
238 views

So I've got the following component working so far records/new/+page.svelte: <script> import RecordForm from "../../../components/forms/RecordForm.svelte"; import TrackForm ...
MrCujo's user avatar
  • 1,393
-1 votes
1 answer
96 views

I have a webpage with several tabs. Inside one of them I include an iframe as a way to manage certain properties, therefore I need the data to be persistent. Each time I change to another tab and come ...
dea's user avatar
  • 1
1 vote
1 answer
84 views

I have a Svelte 5 component who's position is calculated according to its size, which depends on its dynamic content: <script> import { onMount } from "svelte" import { ...
bolino's user avatar
  • 1,162
1 vote
1 answer
419 views

I have a couple of svelte components in a folder and I wish to display in a single page all the components in that folder. The only way I've found is creating an index.ts file in that folder and then ...
Ben Quan's user avatar
  • 839
0 votes
1 answer
115 views

I have a problem in which I have scenario such that recursively same component I want to call in svelte component. They should work like parent and child such like recursively function call. I have ...
Prashant Pandurang Kharade's user avatar
0 votes
1 answer
139 views

In Svelte, I am using the Modal component. This component provides the possibility do declare a div with the property slot="footer". This will keep the footer always at the bottom of the ...
Jacob's user avatar
  • 659
0 votes
1 answer
194 views

Problem I'm having trouble narrowing types with Tanstack Svelte Query. I am migrating my app from React to Svelte. My query queryGetMyPageCollection() returns either an object PageCollection or false....
Patrick Kenny's user avatar
0 votes
1 answer
69 views

I am trying to conditionally render different parts of my navbar to the user depending on if they are logged in or not. I initially achieved this by using the onMount function, but it is not ideal as ...
hypedstan's user avatar
1 vote
1 answer
107 views

I am building a web application with Django as the server and Sveltekit on the client. During the registration process, a link with a token is sent from the server to the user's provided email, when ...
hypedstan's user avatar
5 votes
1 answer
70 views

I have the following component Form.svelte: <script> export let onDelete; </script> <form> <button type="submit">Update</button> <button on:click={...
Patrick Chin's user avatar
0 votes
1 answer
667 views

I have a svelte component that displays a form using https://superforms.rocks and is setup as follows: routes/ ├─ blog/ ├── +page.server.ts ├── +page.svelte ├── component.svelte My experience is that ...
HBCondo's user avatar
  • 929
1 vote
1 answer
894 views

I've built an app localized by Astro's i18n routing. To get the current locale, on server-side I use Astro.currentLocale and on client-side I use window.location.pathname with a helper function that ...
abegehr's user avatar
  • 579
0 votes
0 answers
57 views

I am trying to add some code to previous github repo but while using firebase after creating a page in src/routes folder I am unable to use it. Do I have to use firebase compat? As that also didn't ...
user26268062's user avatar
0 votes
2 answers
306 views

I have a form in a Svelte app like this: <!-- markup for editing todo: label, input text, Cancel and Save Button --> <form on:submit|preventDefault={onSave} class="stack-small" ...
opensas's user avatar
  • 64.4k
-1 votes
1 answer
210 views

I started learning Svelte yesterday as my first frontend Javascript framework, and I've been frustrated trying to fix one problem after another. Today, I have another problem I have been unable to ...
hypedstan's user avatar
0 votes
1 answer
92 views

I have a svelte code.I want to implement a function that the parent component re-executes after the child component is updated. I am facing a problem now.After the child component is updated, the ...
cnfj's user avatar
  • 31
-1 votes
2 answers
155 views

I want to have two inputs: Input A initialy containing a prop named "min" showing the maximum number possible in inputs Input B initialy containing a prop named "max" showing the ...
Magical Briefcase's user avatar
0 votes
1 answer
49 views

In svelte, I would like to strongly type an array to match the properties that a specific component exports. So in the following example I would like const things = [] to know that each item within ...
CT14.IT's user avatar
  • 1,767
0 votes
1 answer
51 views

I have a parent component (List) which displays a list of child components (Block). Nested blocks have a button that allows the user to add/remove them to the selection. The List component also ...
Seglinglin's user avatar
4 votes
1 answer
1k views

In the svelte framework I installed Shadcn UI library and installed three of it's components but now when I try to install any other library it gives me this error. Component.json file looks like this ...
Nikhil Kumar's user avatar
0 votes
1 answer
860 views

I have a svelte component with a default slot and a named slot. I have an instance of that component and use the named slot, and use the default slow inside an {#if} statement checking for a boolean. ...
Justin Golden's user avatar
0 votes
1 answer
446 views

I have a SvelteKit app with an @error.svelte page at the root of the /routes folder. Inside of this page, I have two buttons. One is in the header and the other one trigger's a page event when clicked ...
user2030942's user avatar
0 votes
1 answer
88 views

I am having problems with my custom checkbox component. My goal is for the parant to have control over the selected state of the input. But every time I click the checkbox it gets selected even if ...
Samuel Knoch's user avatar
  • 1,265
0 votes
1 answer
97 views

Radio components are being made and used. However, the input tag cannot be found because the parent page onMount runs earlier than the logic in the component. Is there any way to disable onMount on ...
car's user avatar
  • 3
1 vote
0 answers
82 views

I'm working on a SvelteKit app where I need to conditionally load one of two components, Comp1 or Comp2, based on server-side logic. Here's a simplified overview of my setup: +page.svelte <script ...
Vahid's user avatar
  • 5,514
2 votes
0 answers
323 views

I have a simple custom component in Svelte, where I use reactivity to execute some code. <script lang="ts"> export let liked: boolean $: { //..code that should be ...
scedira's user avatar
  • 31
0 votes
1 answer
352 views

I'm using a library which requires me to create an html element and pass that element. Then the library puts the element in the correct place internally. The problem I'm facing is that the element i ...
Anton's user avatar
  • 821
0 votes
0 answers
545 views

I have a component that accesses a svelte store writable but the component just gets rendered before the data arrives into the store variable. This are the errors enter image description here I want ...
Nico's user avatar
  • 21
0 votes
1 answer
174 views

In normal HTML and CSS you would do this: <span>"Hello, World!"</span> <style> span { background: yellow; /* to see span dimensions */ height: 3rem; } </...
Karim Shaloh's user avatar
0 votes
2 answers
960 views

I've managed to create a Svelte web component that can be used on external websites running on different frameworks. The final problem I'm having is that Tailwind doesn't seem to be included in the ...
Dally's user avatar
  • 1,487
0 votes
1 answer
1k views

About a year ago, I created a Vue web component that could be included on any website to facilitate Open Banking payments in the UK. We've even got a WordPress, Magento & Shopify plugins that uses ...
Dally's user avatar
  • 1,487

1
2 3 4 5
12