Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanety/stimulus-form-groups
https://github.com/kanety/stimulus-form-groups
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kanety/stimulus-form-groups
- Owner: kanety
- License: mit
- Created: 2021-10-09T09:53:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T07:30:29.000Z (7 months ago)
- Last Synced: 2024-10-02T07:39:12.547Z (4 months ago)
- Language: JavaScript
- Size: 67.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# stimulus-form-groups
A stimulus controller for toggle of form groups.
## Dependencies
* @hotwired/stimulus 3.0+
## Installation
Install from npm:
$ npm install @kanety/stimulus-form-groups --save
## Usage
Register controller:
```javascript
import { Application } from '@hotwired/stimulus';
import FormGroupsController from '@kanety/stimulus-form-groups';const application = Application.start();
application.register('form-groups', FormGroupsController);
```Import css:
```css
@import '@kanety/stimulus-form-groups';
```Build html as follows:
```html
group1
group2
group1 content
group2 content
```You can also toggle multiple groups at once:
```html
group1
group2
group1 content
group2 content
```In this example, `group1 content` will be shown whichever options you select.
You can also use multiple input elements by setting combination of name and value as group id:
```html
group1 content
group2 content
```### Options
#### mode
You can toggle disabled status for input elements:
```html
```## License
The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).