Gathering detailed insights and metrics for tailwindcss-stimulus-components
Gathering detailed insights and metrics for tailwindcss-stimulus-components
Gathering detailed insights and metrics for tailwindcss-stimulus-components
Gathering detailed insights and metrics for tailwindcss-stimulus-components
stimulus-rails-nested-form
A Stimulus controller to create new fields on the fly to populate your Rails relationship.
@hotwired/stimulus
A modest JavaScript framework for the HTML you already have.
stimulus-textarea-autogrow
A Stimulus controller for autogrowing textarea.
@stimulus-components/dropdown
A Stimulus controller to create a dropdown.
npm install tailwindcss-stimulus-components
91.3
Supply Chain
99.1
Quality
87.1
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,406 Stars
393 Commits
143 Forks
22 Watching
2 Branches
59 Contributors
Updated on 25 Nov 2024
Minified
Minified + Gzipped
JavaScript (68.89%)
HTML (31.11%)
Cumulative downloads
Total Downloads
Last day
-5.4%
6,589
Compared to previous day
Last week
-4.7%
35,282
Compared to previous week
Last month
24%
150,241
Compared to previous month
Last year
19.9%
1,190,410
Compared to previous year
1
4
This is a set of components (Tabs, Modals, Dropdowns, etc) for TailwindCSS that uses StimulusJS controllers.
The goal is to make using TailwindCSS as easy as Bootstrap when it comes to adding Javascript components.
This assumes that StimulusJS is already installed.
Add the tailwindcss-stimulus-components
module:
1yarn add tailwindcss-stimulus-components
or
1npm install tailwindcss-stimulus-components
or use with Rails importmaps:
1bin/importmap pin tailwindcss-stimulus-components
First, you'll want to initialize StimulusJS and then you can import all the TailwindCSS components.
1// Start StimulusJS 2import { Application } from "@hotwired/stimulus" 3 4const application = Application.start(); 5 6// Import and register all TailwindCSS Components or just the ones you need 7import { Alert, Autosave, ColorPreview, Dropdown, Modal, Tabs, Popover, Toggle, Slideover } from "tailwindcss-stimulus-components" 8application.register('alert', Alert) 9application.register('autosave', Autosave) 10application.register('color-preview', ColorPreview) 11application.register('dropdown', Dropdown) 12application.register('modal', Modal) 13application.register('popover', Popover) 14application.register('slideover', Slideover) 15application.register('tabs', Tabs) 16application.register('toggle', Toggle)
This will start StimulusJS and load any controllers that you have locally and then register the TailwindCSS components.
All of the styles for the Stimulus components are configurable. Our examples above show some example styles you can use, but these components themselves don't require any specific styles.
Stimulus simply requires the data-
attributes to be defined correctly
to trigger actions and find targets.
Some components like the modal have some styles that are necessary for proper use in the browser. The container and backgrounds are separate so that you can have a fixed size container and the modal inside of it.
You can use inheritance to extend the functionality of any Stimulus components.
1import { Dropdown } from "tailwindcss-stimulus-components" 2 3export default class ButtonDropdown extends Dropdown { 4 static targets = ["button"] 5 6 connect() { 7 super.connect(); 8 console.log("the value of button : ", this.buttonTarget.value) 9 } 10}
These controllers will automatically have access to targets
defined in the parent class.
If you override the connect
, disconnect
or any other methods from the parent, you'll want to call super.method()
to make sure the parent functionality is executed.
To develop locally, run npx serve
and open your browser to the URL it serves on.
Bug reports and pull requests are welcome on GitHub at https://github.com/excid3/tailwindcss-stimulus-components. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
To run tests:
1npm install 2npm run test
This package is available as open source under the terms of the MIT License.
No vulnerabilities found.
Reason
18 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 11/27 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More