- Include the file
dist/js/stacks.min.jsin your page. For example, if you use the unpkg CDN, add the tag
<script src="https://unpkg.com/@stackoverflow/stacks/dist/js/stacks.min.js"></script>to your HTML. See Using Stacks for more information on Unpkg and installing Stacks via NPM.
- If you need to support Internet Explorer 11, you also have to include a polyfill
Stimulus allows you to add functionality to your markup in a way that is similar to how you add styling to your markup: by modifying HTML attributes.
Just as you style components by adding classes to the
data-… attributes to the HTML.
s-…, just like component CSS classes. You give functionality to an HTML element by setting its
1 <div class="s-magic-widget s-magic-widget__awesome" data-controller="s-magic-widget"></div>
Refer to the documentation of individual components on how to configure a component’s behavior.