Skip to content

Commit

Permalink
Update 03_components.md (#160)
Browse files Browse the repository at this point in the history
Hopefully better reading. I had to re-read a few times to understand the intent
  • Loading branch information
RandomInsano authored Jan 25, 2025
1 parent dce41f9 commit 6fb6880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/view/03_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ and see the power of the `#[component]` macro combined with rust-analyzer here.

Sometimes you want users to be able to add additional attributes to a component. For example, you might want users to be able to add their own `class` or `id` attributes for styling or other purposes.

You _could_ do this by creating `class` or `id` props that you then apply to the appropriate element. But Leptos also supports “spreading” additional attributes onto components. Attributes added to a component will be applied to all top-level HTML elements that components returns from its view.
You _could_ do this by creating `class` or `id` props that you then apply to the appropriate element. But Leptos also supports “spreading” additional attributes onto components. Attributes added to a component will be applied to all top-level HTML elements returned from its view.

```rust
// you can create attribute lists by using the view macro with a spread {..} as the tag name
Expand Down

0 comments on commit 6fb6880

Please sign in to comment.