summaryrefslogtreecommitdiff
path: root/.changeset/lovely-bulldogs-admire.md
blob: 74888cb27df2da2e431fba5c9b6c4ffdd7bb5f79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
'@astrojs/preact': minor
'@astrojs/react': minor
'@astrojs/solid-js': minor
---

Add support for passing named slots from `.astro` => framework components.

Each `slot` is be passed as a top-level prop. For example:

```jsx
// From .astro
<Component>
  <h2 slot="title">Hello world!</h2>
  <h2 slot="slot-with-dash">Dash</h2>
  <div>Default</div>
</Component>

// For .jsx
export default function Component({ title, slotWithDash, children }) {
  return (
    <>
      <div id="title">{title}</div>
      <div id="slot-with-dash">{slotWithDash}</div>
      <div id="main">{children}</div>
    </>
  )
}
```