You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
18
18
19
19
## [Unreleased]
20
20
21
+
### Changed
22
+
23
+
- Improved handling of boolean attributes to support all forms of Django template syntax and string values. The attribute name alone (`disabled`), explicit booleans (`disabled=True`), or string values (`disabled="True"`) all work as expected - rendering just the attribute name when true and omitting it when false.
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,27 +68,30 @@ templates/
68
68
└── button.html
69
69
```
70
70
71
-
In `button.html`, create a simple HTML button. Use `{{ slot }}` to indicate where the main content will go.
71
+
In `button.html`, create a simple HTML button. Use `{{ slot }}` to indicate where the main content will go. We will also define a component property via the `{% bird:prop %}` templatetag and add `{{ attrs }}`forpassingin arbitrary HTML attributes.
To use your component in a Django template, use the `{% bird %}` templatetag. The content between `{% bird %}` and `{% endbird %}` becomes the `{{ slot }}` content.
83
+
To use your component in a Django template, use the `{% bird %}` templatetag. The content between `{% bird %}` and `{% endbird %}` becomes the `{{ slot }}` content. Properties and attributes are set as parameters on the `{% bird %}` tag itself.
django-bird automatically recognizes components in the bird directory, so no manual registration is needed. When Django processes the template, django-bird replaces the `{% bird %}` tag with the component's HTML, inserting the provided content into the slot, resulting in:
@@ -100,9 +103,10 @@ You now have a button component that can be easily reused across your Django pro
100
103
101
104
django-bird offers features for creating flexible components, such as:
102
105
103
-
- Passing attributes to components
104
-
- Named slots for organizing content within components
105
-
- Subcomponents for building complex component structures
106
+
- [Defining and registering components](https://django-bird.readthedocs.io/en/latest/naming.html) entirely within Django templates, without writing a custom templatetag
107
+
- Passing [attributes and properties](https://django-bird.readthedocs.io/en/latest/params.html) to components
108
+
- [Named slots](https://django-bird.readthedocs.io/en/latest/slots.html#named-slots) for organizing content within components
109
+
- [Subcomponents](https://django-bird.readthedocs.io/en/latest/organization.html) for building complex component structures
106
110
107
111
For a full overview of the features and configuration options, please refer to the [documentation](https://django-bird.readthedocs.io).
Copy file name to clipboardExpand all lines: docs/params.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Note that these parameters are distinct from [Slots](slots.md) - they are used t
9
9
For example, a button component might use properties to control its styling and attributes to set HTML attributes, while using slots to define its content:
0 commit comments