Everything you need to build a Svelte project, powered by create-svelte
.
If you're seeing this, you've probably already done this step. Congrats!
# install dependencies
npm install
# start local development version
npm run dev
# or start the server and open the app in a new browser tab, project should be available on http://localhost:5173 in your browser
npm run dev -- --open
I also added a fake API - getFromApi
for retrieving fake cart and products data. See example in index.svelte for usage. Both include a delay to simulate network loading.
Adjust the /routes/index.svelte
create necessary files in the components
folder to:
Display a loading info while the products are in loading state
Change index.svelte
to display a tile for each product with the following infos:
The tiles should be displayed in a grid and as a list on screens below 480px. In the grid the minimum tile width should be 300px and maximum should be 400px with as many tiles as possible should fit on screen.
Add an search input field on top that allows filtering the products that contain the input in the product name.
Bonus:
sku
field to find the matching products)Currently the project uses typescript, but you can rename / create js/jsx files if you want to opt out of type checking
Even though this project is fairly simple try to organize it like you would do for larger components.
Don't worry too much about styling
Feel free to reach out if you have any questions
Good luck