Svelte · Junior · Question 28 of 76

How do you use one component inside another?

<script>
  import Button from "./Button.svelte";
</script>

<Button label="Save" />

Explanation

Component names start with a capital letter so the compiler can tell them from HTML elements.

Further reading

Problem with a question

Svelte · Junior · question 28

Test yourself

Take the Svelte · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz