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
npm install tailwindcss-stimulus-components
Typescript
Module System
Node Version
NPM Version
98.4
Supply Chain
99.1
Quality
83.2
Maintenance
100
Vulnerability
100
License
JavaScript (68.91%)
HTML (31.09%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
3,757,705
Last Day
2,271
Last Week
35,731
Last Month
149,137
Last Year
1,366,430
MIT License
1,444 Stars
405 Commits
143 Forks
22 Watchers
3 Branches
61 Contributors
Updated on Feb 18, 2025
Latest Version
6.1.3
Package Id
tailwindcss-stimulus-components@6.1.3
Unpacked Size
114.33 kB
Size
26.80 kB
File Count
17
NPM Version
10.8.3
Node Version
18.18.0
Published on
Dec 11, 2024
Cumulative downloads
Total Downloads
Last Day
0%
2,271
Compared to previous day
Last Week
-5.8%
35,731
Compared to previous week
Last Month
24.4%
149,137
Compared to previous month
Last Year
40%
1,366,430
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
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 8/21 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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 2025-02-10
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