Awesome Vue Slots
An awesome list of components and resources for vue slots.
Note: This is this is heavily inspired by awesome-react-render-props by Jared Palmer. Thanks Jared!
PRs welcome!
What are slots?
Vue supports slots, which provide a way distribute content between components. They're an outstanding way to make your components truly reusable.
π Read the documentation for motivation and overview!
What are scoped slots? π¬
As of Vue version 2.1.0, scoped slots extend the capability of slots. One can now pass a template to a slot; the template is rendered in the parent scope, but it has access to child data.
This is a more advanced pattern, but that doesn't mean you can't learn them!
Note: We'll use a π¬ to indicate items that have to do with scoped slot
Here's some material to help motivate scoped slots:
- π Scoped Slots Documentation
- π¦ Scoped slots are vue's version of render props.
- π€ Full Stack Radio: Evan You - Advanced Vue Component Design
Videos πΊ
- Named Slots in a Nutshell by Laracasts
- π΅ Place Content in Components with Vue Slots by John Lindquist
- π΅ Create Layouts with Named Vue Slots by John Lindquist
- π¬ Scoped Slots by Laracasts
- π¬ π΅ Pass Props Between Components with Vue Slot Scope by John Lindquist
Articles π
- Intro to Vue.js: Components, Props, and Slots by Sarah Drasner
- Creating Reusable Transitions in Vue by Cristi Jora
- π¬ Getting Your Head Around Vue.js Scoped Slots by Anthony Gore
- π¬ Understanding Scoped Slots in Vue.js by Cristi Jora
Examples π»
- π¬ Getting Your Head Around Vue.js Scoped Slots by Anthony Gore
- π¬ Mouse Position Example by Darren Jennings
Components
- π¬ vue-table-component
- π¬ vue-slider-component
- π¬ vue-tweezing
- π¬ vue-scrollview
- π¬ vue-countdown