Chapter quiz · Components & Templating

Test what you learned.

8 questions on Components & Templating. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Components & Templating — Chapter Quiz

Eight questions on props, slots, conditionals, lists, styling.

0/ 8
  1. Question 1
    1

    How do you receive props in an Astro component?

  2. Question 2
    2

    Astro requires key={...} when rendering lists.

  3. Question 3
    3

    To inject pre-rendered HTML safely, use…

  4. Question 4
    4

    A component has <slot name="header" />. The caller fills it with…

  5. Question 5
    5

    What's the rendered class on the button?

    ---
    const big = true;
    const danger = false;
    ---
    <button class:list={["btn", big && "btn--lg", danger && "btn--danger"]}>OK</button>
    
  6. Question 6
    6

    Component-scoped styles automatically apply to elements rendered by child components.

  7. Question 7
    7

    How do you write an HTML attribute that's dynamic?

  8. Question 8
    8

    To make a <style> block apply globally, add the directive is:_______.

Pick an answer — instant feedback as you go.