Select bindings Select bindings We can also use bind:value with <select> elements. Update line 24: <select bind:value = {selected} on:change = "{() => answer = ''}"> ...
The class directive The class directive Like any other attribute, you can specify classes with a JavaScript attribute, seen here: <button class = "{current === 'foo' ?...
Else blocks Else blocks Since the two conditions — if user.loggedIn and if !user.loggedIn — are mutually exclusive, we can simplify this component slightly by using an else ...
In and out In and out Instead of the transition directive, an element can have an in or an out directive, or both together. Import fade alongside fly … import { fade ,...
Quick Start Guide Slow Start Guide Storybook for HTML Storybook for React Storybook for React Native Storybook for Vue Storybook for Angular Storybook for Mithril Storybo...
Spread props Spread props If you have an object of properties, you can ‘spread’ them on to a component instead of specifying each one: <Info {... pkg } /> Conversely, i...
Text inputs Text inputs As a general rule, data flow in Svelte is top down — a parent component can set props on a child component, and a component can set attributes on an el...
Integrations What is an API? Get started Integrations Strapi generates an API for you to access your content. But how can you connect a React, Ruby, Gatsby application to it?...