Solid JS frameworks support

https://www.solidjs.com/
Codegen
https://www.solidjs.com/tutorial/bindings_style
Styling
inline-style
unlike react, solidjs uses the default css property name (kebab-case) with "" - "font-size" (react: fontSize)
<div style={{
color: `rgb(${num()}, 180, ${num()})`,
"font-weight": 800,
"font-size": `${num()}px`}}
>
Some Text
</div>
styled-components
Solid offers an official wrap of styled-components implementation of its own. - solid-styled-components
differences from react: styled-compoents are..
- use named imports (not default import)
- use call signature instead of property signature
styled.div -> styled("div")
- has built-in css obj support ->
import { css } from "solid-styled-components";
import { styled } from "solid-styled-components";
const Btn = styled("button")`
border-radius: 4px;
`;
styled-jsx (by vercel) unofficial wrapper
https://github.com/solidjs/solid-styled-jsx
function Button() {
const [isLoggedIn, login] = createSignal(false);
return (
<>
<button className="button" onClick={() => login(!isLoggedIn())}>
{isLoggedIn() ? "Log Out" : "Log In"}
</button>
<style jsx dynamic>
{`
.button {
background-color: ${isLoggedIn() ? "blue" : "green"};
color: white;
padding: 20px;
margin: 10px;
}
`}
</style>
</>
);
}
States & Events
Lifecycles
Testing
Unique Elements
<For>
<Show>
<Switch>/<Match>
<Index>
<ErrorBoundary>
<Suspense>
<Dynamic>
<Protal>
Special Attributes
- ref
- classList
- style
- on:x
- use:x
- prop:x
- attr:x
/* @once */
Runtime & Env / Editor
WIP
tsx/jsx
https://www.solidjs.com/guides/typescript#configuring-typescript
{
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js"
}
}
Examples
- working examples
- realworld app examples (human written)
References
Resources
Note: Differences from react
Solid JS frameworks support
Codegen
https://www.solidjs.com/tutorial/bindings_style
Styling
inline-style
unlike react, solidjs uses the default css property name (kebab-case) with
""-"font-size"(react:fontSize)styled-components
Solid offers an official wrap of styled-components implementation of its own. -
solid-styled-componentsdifferences from react:
styled-compoentsare..styled.div->styled("div")import { css } from "solid-styled-components";styled-jsx (by vercel) unofficial wrapper
States & Events
Lifecycles
Testing
Unique Elements
<For><Show><Switch>/<Match><Index><ErrorBoundary><Suspense><Dynamic><Protal>Special Attributes
/* @once */Runtime & Env / Editor
WIP
tsx/jsx
https://www.solidjs.com/guides/typescript#configuring-typescript
{ "compilerOptions": { "jsx": "preserve", "jsxImportSource": "solid-js" } }Examples
References
Resources
Note: Differences from react
classattribute (noclassName) - to specify multiple, we can useclassList(not found in react)styled("div")like sytax (Why not support property access style usage? styled.div instead of styled("div") solidjs/solid-styled-components#28)