Skip to content

Commit 5664dac

Browse files
committed
readme update
1 parent 1968612 commit 5664dac

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,16 @@ module_logger.debug(f"Creating user with username: {username} and email: {email}
177177
```
178178
In this example, module_logger logs a debug message when a new user is being created. This helps you track user creation activities.
179179

180-
# JavaScript Modules for Enhanced Interactivity
181-
This project includes JavaScript modules to add interactive features to your Django templates.
180+
# Modules for Enhanced Frontend Interactivity
182181

183-
Check the console for warnings and errors that should guide you through the process in case you are stuck.
182+
This project provides a collection of JavaScript modules designed to supercharge your Django templates with interactive features,
183+
**without the need for any custom JavaScript code**.
184+
Simply load the corresponding template tags, add some data attributes to your HTML elements, and let the magic happen!
185+
186+
- Seamless Django Integration: The modules are built to work effortlessly with Django's templating system.
187+
- Zero JavaScript Overhead: You don't need to write or manage any custom JavaScript code.
188+
- Enhanced User Experience: Add rich interactivity to your web pages with minimal effort.
189+
- Customizable: Tailor the modules to your specific design and functionality needs using intuitive data attributes.
184190

185191
## ToggledButtonGroup
186192
Visit [BaseApp/button_examples.html](BaseApp/templates/BaseApp//ui_elements/sections/buttons_examples.html) for an example.
@@ -220,11 +226,11 @@ The `ToggledButtonGroup` class allows you to create interactive button groups wh
220226
`data-active-class`: Specifies the CSS class(es) to apply to the active button. You can include multiple classes separated by spaces (e.g., bg-blue-500 text-white).
221227

222228
`data-initial-active`: Determines which button should be active when the page loads. It can be:
223-
"none": No button is active initially. (DEFAULT)
224-
"first": Activates the first button.
225-
"last": Activates the last button.
226-
"random": A random button is activated.
227-
"0", "1", "2", etc.: Activates the button at the specified index.
229+
- "none": No button is active initially. (DEFAULT)
230+
- "first": Activates the first button.
231+
- "last": Activates the last button.
232+
- "random": A random button is activated.
233+
- "0", "1", "2", etc.: Activates the button at the specified index.
228234

229235
3. **Initialize with the Django Template Tag**:
230236

@@ -238,15 +244,13 @@ The `ToggledButtonGroup` class allows you to create interactive button groups wh
238244
- You can initialize all button groups on the page with `{% init_button_groups %}` or you can initialize a specific button groups with `{% init_button_groups "name1" "name2" "name3" %}`.
239245

240246
### HTMX Integration (GET)
241-
The `ToggledButtonGroup` class seamlessly integrates with HTMX, a powerful library for building modern, interactive user interfaces with less JavaScript. You can easily use HTMX to update portions of your page in response to button clicks within your toggled button group.
242-
243-
- **HTMX Library:** Ensure that you have included the HTMX library in your HTML.
247+
The `ToggledButtonGroup` class seamlessly integrates with HTMX. If your buttons have the `hx-get` attribute, the `ToggledButtonGroup` class will automatically update the page based on the `data-initial-active` attribute.
244248

245249
- **HTMX Attributes:** Add HTMX attributes to the buttons within your button group container. The most common attributes you'll use are:
246250
- `hx-get`: Specifies the URL to fetch when the button is clicked.
247251
- `hx-target`: Specifies the element on the page to update with the content returned by the HTMX request.
248252
- `hx-swap`: Specifies how the returned content should be swapped into the target element (e.g., "innerHTML", "outerHTML", "beforeend").
249-
- **Example**
253+
**Example:**
250254
```html
251255
<div id="myButtonGroup-button-group"
252256
data-initial-active="random">

0 commit comments

Comments
 (0)