From fcc85eafac3fe3b3528cb899481272ab06fd1fbf Mon Sep 17 00:00:00 2001 From: Santiago Ferreira Date: Sun, 11 Jun 2017 11:16:11 -0300 Subject: [PATCH] Explain how attributes are accesible from component's template --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index c3ab7bb..2d5a036 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,24 @@ Then you can use these helpers from your templates <% end %> ``` +### 5. Using attributes inside your components + +When calling a component you can pass any attribute you like. + +```eex +<%= button type: :submit do %> + Submit form! +<% end %> +``` + +Inside the component's template these attributes are going to be available in the `@attrs` map. + +```eex +