Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsca committed Aug 18, 2024
1 parent 7b52acf commit 77ddac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 5 additions & 7 deletions docs/content/guide/slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ The `_slot` variable is scoped to the content of that component, so it's not ava

Named slots are a quick way to have multiple content slots, but are a bit messy beyond some simple cases.

Composability offers a more flexible and idiomatic approach when multiple content slots are needed. The idea is to have separated components for each content slot, and then compose them together.

This pattern allows allows for more reusable components. Let's explore this concept using the same example as above.
Composability offers a more flexible and idiomatic approach when multiple content slots are needed. The idea is to have separated components for each content slot, and then compose them together. Let's explore this concept using the same example as above.

Consider a `Modal` component that requires three distinct sections: a header, a body, and a footer. Instead of using named slots, we can create separate components for each section and composing them within a `Modal` component wrapper.

Expand Down Expand Up @@ -153,10 +151,10 @@ Now, the `Modal` component is responsible for rendering the outer `<dialog>` and
<ExampleTabs
prefix="slots-modal"
panels={{ {
"Modal": "guide.slots.Modal",
"ModalHeader": "guide.slots.ModalHeader",
"ModalBody": "guide.slots.ModalBody",
"ModalFooter": "guide.slots.ModalFooter",
"Modal.jinja": "guide.slots.Modal",
"ModalHeader.jinja": "guide.slots.ModalHeader",
"ModalBody.jinja": "guide.slots.ModalBody",
"ModalFooter.jinja": "guide.slots.ModalFooter",
} }}
/>

Expand Down
7 changes: 6 additions & 1 deletion docs/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
"guide/motivation.md",
],
],
"api.md",
[
"API",
[
"api.md",
],
],
[
"UI components", [
"ui/index.md",
Expand Down

0 comments on commit 77ddac9

Please sign in to comment.