├── netlify.toml
├── src
├── global.d.ts
├── routes
│ ├── [...404].tsx
│ ├── solid-meta
│ │ ├── reference
│ │ │ ├── data.json
│ │ │ └── meta
│ │ │ │ ├── data.json
│ │ │ │ ├── metaprovider.mdx
│ │ │ │ ├── title.mdx
│ │ │ │ ├── base.mdx
│ │ │ │ ├── style.mdx
│ │ │ │ └── meta.mdx
│ │ ├── data.json
│ │ ├── getting-started
│ │ │ ├── data.json
│ │ │ ├── client-setup.mdx
│ │ │ └── server-setup.mdx
│ │ └── index.mdx
│ ├── solid-router
│ │ ├── guides
│ │ │ └── data.json
│ │ ├── rendering-modes
│ │ │ ├── data.json
│ │ │ ├── spa.mdx
│ │ │ └── ssr.mdx
│ │ ├── reference
│ │ │ ├── preload-functions
│ │ │ │ └── data.json
│ │ │ ├── response-helpers
│ │ │ │ └── data.json
│ │ │ ├── data.json
│ │ │ ├── components
│ │ │ │ ├── data.json
│ │ │ │ ├── navigate.mdx
│ │ │ │ └── route.mdx
│ │ │ ├── data-apis
│ │ │ │ ├── data.json
│ │ │ │ ├── use-action.mdx
│ │ │ │ └── revalidate.mdx
│ │ │ └── primitives
│ │ │ │ ├── data.json
│ │ │ │ ├── use-is-routing.mdx
│ │ │ │ ├── use-current-matches.mdx
│ │ │ │ ├── use-resolved-path.mdx
│ │ │ │ ├── use-navigate.mdx
│ │ │ │ ├── use-location.mdx
│ │ │ │ ├── use-preload-route.mdx
│ │ │ │ ├── use-before-leave.mdx
│ │ │ │ ├── use-params.mdx
│ │ │ │ └── use-match.mdx
│ │ ├── advanced-concepts
│ │ │ ├── data.json
│ │ │ └── lazy-loading.mdx
│ │ ├── data-fetching
│ │ │ ├── data.json
│ │ │ └── how-to
│ │ │ │ ├── data.json
│ │ │ │ └── handle-error-and-loading-states.mdx
│ │ ├── getting-started
│ │ │ └── data.json
│ │ ├── data.json
│ │ ├── concepts
│ │ │ ├── data.json
│ │ │ └── catch-all.mdx
│ │ └── index.mdx
│ ├── reference
│ │ ├── lifecycle
│ │ │ ├── data.json
│ │ │ ├── on-mount.mdx
│ │ │ └── on-cleanup.mdx
│ │ ├── server-utilities
│ │ │ └── data.json
│ │ ├── basic-reactivity
│ │ │ └── data.json
│ │ ├── component-apis
│ │ │ ├── data.json
│ │ │ ├── use-context.mdx
│ │ │ └── create-unique-id.mdx
│ │ ├── store-utilities
│ │ │ ├── data.json
│ │ │ ├── unwrap.mdx
│ │ │ └── produce.mdx
│ │ ├── secondary-primitives
│ │ │ ├── data.json
│ │ │ ├── create-reaction.mdx
│ │ │ └── create-deferred.mdx
│ │ ├── rendering
│ │ │ ├── data.json
│ │ │ ├── is-server.mdx
│ │ │ ├── dev.mdx
│ │ │ ├── render-to-string.mdx
│ │ │ ├── hydration-script.mdx
│ │ │ ├── hydrate.mdx
│ │ │ ├── render-to-string-async.mdx
│ │ │ └── render.mdx
│ │ ├── data.json
│ │ ├── components
│ │ │ ├── data.json
│ │ │ ├── no-hydration.mdx
│ │ │ └── dynamic.mdx
│ │ ├── jsx-attributes
│ │ │ ├── data.json
│ │ │ ├── innerhtml.mdx
│ │ │ ├── prop.mdx
│ │ │ ├── attr.mdx
│ │ │ ├── textcontent.mdx
│ │ │ ├── once.mdx
│ │ │ ├── bool.mdx
│ │ │ ├── ref.mdx
│ │ │ ├── style.mdx
│ │ │ └── on.mdx
│ │ └── reactive-utilities
│ │ │ ├── data.json
│ │ │ ├── start-transition.mdx
│ │ │ ├── catch-error.mdx
│ │ │ ├── use-transition.mdx
│ │ │ ├── observable.mdx
│ │ │ ├── merge-props.mdx
│ │ │ ├── index-array.mdx
│ │ │ ├── map-array.mdx
│ │ │ ├── untrack.mdx
│ │ │ ├── get-owner.mdx
│ │ │ ├── from.mdx
│ │ │ └── split-props.mdx
│ ├── advanced-concepts
│ │ └── data.json
│ ├── solid-start
│ │ ├── reference
│ │ │ ├── config
│ │ │ │ └── data.json
│ │ │ ├── routing
│ │ │ │ ├── data.json
│ │ │ │ └── file-routes.mdx
│ │ │ ├── client
│ │ │ │ ├── data.json
│ │ │ │ ├── start-client.mdx
│ │ │ │ └── mount.mdx
│ │ │ ├── data.json
│ │ │ ├── entrypoints
│ │ │ │ ├── data.json
│ │ │ │ ├── entry-client.mdx
│ │ │ │ ├── app-config.mdx
│ │ │ │ ├── entry-server.mdx
│ │ │ │ └── app.mdx
│ │ │ └── server
│ │ │ │ ├── data.json
│ │ │ │ ├── start-server.mdx
│ │ │ │ ├── get-server-function-meta.mdx
│ │ │ │ ├── get.mdx
│ │ │ │ ├── http-header.mdx
│ │ │ │ └── create-handler.mdx
│ │ ├── guides
│ │ │ ├── data.json
│ │ │ └── service-workers.mdx
│ │ ├── data.json
│ │ ├── advanced
│ │ │ ├── data.json
│ │ │ ├── request-events.mdx
│ │ │ ├── auth.mdx
│ │ │ └── websocket.mdx
│ │ └── building-your-application
│ │ │ ├── data.json
│ │ │ └── route-prerendering.mdx
│ ├── concepts
│ │ ├── derived-values
│ │ │ ├── data.json
│ │ │ └── derived-signals.mdx
│ │ ├── components
│ │ │ └── data.json
│ │ ├── control-flow
│ │ │ └── data.json
│ │ └── data.json
│ ├── configuration
│ │ └── data.json
│ ├── data.json
│ └── guides
│ │ ├── styling-components
│ │ ├── data.json
│ │ └── less.mdx
│ │ ├── deployment-options
│ │ ├── data.json
│ │ ├── stormkit.mdx
│ │ └── aws-via-sst.mdx
│ │ ├── data.json
│ │ └── deploying-your-app.mdx
├── entry-client.tsx
├── middleware
│ └── index.ts
├── ui
│ ├── layout
│ │ ├── hero-code-snippet.code
│ │ ├── side-panel.tsx
│ │ ├── hero-code-snippet.tsx
│ │ ├── contribute.tsx
│ │ └── mobile-navigation.tsx
│ ├── eraser-link
│ │ └── eraser-link.css
│ ├── not-found.tsx
│ ├── edit-page-link.tsx
│ ├── button-link.tsx
│ ├── i18n-anchor.tsx
│ ├── page-issue-link.tsx
│ ├── use-project.ts
│ └── tabs.tsx
├── i18n
│ ├── dictionaries
│ │ ├── index.ts
│ │ └── pt-br
│ │ │ └── ui.ts
│ ├── config.ts
│ ├── translator.ts
│ ├── helpers.ts
│ └── i18n-context.tsx
├── app.tsx
├── data
│ └── get-nav.tsx
├── entry-server.tsx
├── solidbase-theme
│ └── Layout.tsx
├── styles
│ ├── prism.css
│ └── fonts.css
└── utils
│ └── route-metadata-helper.ts
├── .prettierignore
├── public
├── favicon.ico
├── fonts
│ ├── Geist-Bold.woff2
│ ├── Geist-Light.woff2
│ ├── Geist-Medium.woff2
│ ├── Geist-Regular.woff2
│ ├── Inter-Regular.woff2
│ ├── Geist-SemiBold.woff2
│ ├── GeistMono-Bold.woff2
│ ├── GeistMono-Medium.woff2
│ ├── GeistMono-Regular.woff2
│ └── GeistMono-SemiBold.woff2
├── robots.txt
├── images
│ ├── tutorial
│ │ ├── solid-start-app.png
│ │ ├── template-files-js.png
│ │ └── template-files-ts.png
│ └── how-to-guides
│ │ ├── deployment
│ │ ├── netlify-deploy.png
│ │ ├── vercel-deploy.png
│ │ ├── vercel-login.png
│ │ ├── cloudflare-login.png
│ │ ├── cloudflare-setup.png
│ │ ├── google-cloud-create.png
│ │ ├── netlify-cli-success.png
│ │ ├── netlify-dashboard.png
│ │ ├── railway-dashboard.png
│ │ ├── railway-new-project.png
│ │ ├── vercel-deploy-done.png
│ │ ├── vercel-import-repo.png
│ │ ├── cloudflare-dashboard.png
│ │ ├── firebase-deploy-done.png
│ │ ├── Flightcontrol-link-AWS.png
│ │ ├── flightcontrol-services.png
│ │ ├── netlify-connect-import.png
│ │ ├── railway-deploy-success.png
│ │ ├── railway-generate-domain.png
│ │ ├── railway-select-project.png
│ │ ├── cloudflare-after-connection.png
│ │ ├── flightcontrol-config-option.png
│ │ ├── flightcontrol-connect-github.png
│ │ ├── flightcontrol-static-website.png
│ │ ├── google-cloud-container-registry.png
│ │ └── google-cloud-project-dashboard.png
│ │ └── comparison
│ │ └── react
│ │ ├── react-simple-state-update-dark.png
│ │ ├── solid-simple-state-update-dark.png
│ │ ├── react-simple-state-update-light.png
│ │ └── solid-simple-state-update-light.png
├── assets
│ ├── vercel.svg
│ ├── cloudflare-pages.svg
│ ├── tailwind.svg
│ ├── netlify.svg
│ ├── uno.svg
│ ├── stormkit.svg
│ ├── railway.svg
│ ├── zerops.svg
│ └── firebase.svg
├── scripts
│ └── browser-specific.js
└── favicon.svg
├── postcss.config.js
├── .prettierrc
├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── OTHER.yml
│ ├── REQUEST.yml
│ ├── CONTENT.yml
│ └── BUGS.yml
├── dependabot.yml
├── actions
│ └── install
│ │ └── action.yml
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── static_checks.yml
│ └── orama_sync.yml
├── scripts
├── collections
│ ├── utils
│ │ ├── create-dir.mjs
│ │ ├── get-frontmatter.mjs
│ │ ├── write-file.mjs
│ │ └── get-dir-data.mjs
│ ├── create-flat-entry-list.mjs
│ ├── create-nav-tree.mjs
│ └── schemas.mjs
└── generateSitemap.js
├── tsconfig.json
├── .kodiak.toml
├── global.d.ts
├── env.d.ts
├── .gitignore
├── tailwind.config.ts
└── eslint.config.ts
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | publish = "dist/"
--------------------------------------------------------------------------------
/src/global.d.ts:
--------------------------------------------------------------------------------
1 | //
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .solid
2 | dist
3 | *.min.*
4 | package-lock.json
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/routes/[...404].tsx:
--------------------------------------------------------------------------------
1 | export default function NoEntry() {
2 | throw new Error("404");
3 | }
4 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Reference",
3 | "pages": ["meta"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-router/guides/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Guides",
3 | "pages": ["migration.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/public/fonts/Geist-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Geist-Bold.woff2
--------------------------------------------------------------------------------
/src/routes/solid-meta/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "root",
3 | "pages": ["index.mdx", "getting-started"]
4 | }
5 |
--------------------------------------------------------------------------------
/public/fonts/Geist-Light.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Geist-Light.woff2
--------------------------------------------------------------------------------
/public/fonts/Geist-Medium.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Geist-Medium.woff2
--------------------------------------------------------------------------------
/public/fonts/Geist-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Geist-Regular.woff2
--------------------------------------------------------------------------------
/public/fonts/Inter-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Inter-Regular.woff2
--------------------------------------------------------------------------------
/public/fonts/Geist-SemiBold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/Geist-SemiBold.woff2
--------------------------------------------------------------------------------
/public/fonts/GeistMono-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/GeistMono-Bold.woff2
--------------------------------------------------------------------------------
/public/fonts/GeistMono-Medium.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/GeistMono-Medium.woff2
--------------------------------------------------------------------------------
/public/fonts/GeistMono-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/GeistMono-Regular.woff2
--------------------------------------------------------------------------------
/public/fonts/GeistMono-SemiBold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/fonts/GeistMono-SemiBold.woff2
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-Agent: *
2 | Allow: /
3 | Disallow: /i18n-status/
4 | Sitemap: https://docs.solidjs.com/sitemap.xml
5 |
--------------------------------------------------------------------------------
/src/routes/reference/lifecycle/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Lifecycle",
3 | "pages": ["on-mount.mdx", "on-cleanup.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/advanced-concepts/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Advanced concepts",
3 | "pages": ["fine-grained-reactivity.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-router/rendering-modes/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Rendering modes",
3 | "pages": ["spa.mdx", "ssr.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/config/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Config",
3 | "pages": [
4 | "define-config.mdx"
5 | ]
6 | }
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/routing/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Routing",
3 | "pages": [
4 | "file-routes.mdx"
5 | ]
6 | }
--------------------------------------------------------------------------------
/public/images/tutorial/solid-start-app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/tutorial/solid-start-app.png
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/preload-functions/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Preload functions",
3 | "pages": ["preload.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/public/images/tutorial/template-files-js.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/tutorial/template-files-js.png
--------------------------------------------------------------------------------
/public/images/tutorial/template-files-ts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/tutorial/template-files-ts.png
--------------------------------------------------------------------------------
/src/routes/concepts/derived-values/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Derived values",
3 | "pages": ["derived-signals.mdx", "memos.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/configuration/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Configuration",
3 | "pages": ["environment-variables.mdx", "typescript.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/reference/server-utilities/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Server utilities",
3 | "pages": [
4 | "get-request-event.mdx"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | "tailwindcss/nesting": {},
4 | tailwindcss: {},
5 | autoprefixer: {},
6 | },
7 | };
8 |
--------------------------------------------------------------------------------
/public/assets/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/entry-client.tsx:
--------------------------------------------------------------------------------
1 | import { mount, StartClient } from "@solidjs/start/client";
2 |
3 | mount(() => , document.getElementById("app")!);
4 |
--------------------------------------------------------------------------------
/src/routes/solid-router/advanced-concepts/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Advanced concepts",
3 | "pages": ["preloading.mdx", "lazy-loading.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/concepts/components/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Components",
3 | "pages": ["basics.mdx", "class-style.mdx", "event-handlers.mdx", "props.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/response-helpers/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Response helpers",
3 | "pages": ["json.mdx", "redirect.mdx", "reload.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/netlify-deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/netlify-deploy.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/vercel-deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/vercel-deploy.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/vercel-login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/vercel-login.png
--------------------------------------------------------------------------------
/src/routes/solid-router/data-fetching/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Data fetching",
3 | "pages": ["queries.mdx", "streaming.mdx", "revalidation.mdx", "how-to"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-router/data-fetching/how-to/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "How to",
3 | "pages": ["preload-data.mdx", "handle-error-and-loading-states.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/cloudflare-login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/cloudflare-login.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/cloudflare-setup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/cloudflare-setup.png
--------------------------------------------------------------------------------
/src/routes/solid-router/getting-started/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Getting started",
3 | "pages": ["installation-and-setup.mdx", "component.mdx", "config.mdx"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/client/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Client",
3 | "pages": [
4 | "client-only.mdx",
5 | "mount.mdx",
6 | "start-client.mdx"
7 | ]
8 | }
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/google-cloud-create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/google-cloud-create.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/netlify-cli-success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/netlify-cli-success.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/netlify-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/netlify-dashboard.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/railway-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/railway-dashboard.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/railway-new-project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/railway-new-project.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/vercel-deploy-done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/vercel-deploy-done.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/vercel-import-repo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/vercel-import-repo.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/cloudflare-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/cloudflare-dashboard.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/firebase-deploy-done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/firebase-deploy-done.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/Flightcontrol-link-AWS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/Flightcontrol-link-AWS.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/flightcontrol-services.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/flightcontrol-services.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/netlify-connect-import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/netlify-connect-import.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/railway-deploy-success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/railway-deploy-success.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/railway-generate-domain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/railway-generate-domain.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/railway-select-project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/railway-select-project.png
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "es5",
3 | "tabWidth": 2,
4 | "semi": true,
5 | "singleQuote": false,
6 | "useTabs": true,
7 | "plugins": ["prettier-plugin-tailwindcss"]
8 | }
9 |
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/cloudflare-after-connection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/cloudflare-after-connection.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/flightcontrol-config-option.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/flightcontrol-config-option.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/flightcontrol-connect-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/flightcontrol-connect-github.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/flightcontrol-static-website.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/flightcontrol-static-website.png
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Reference",
3 | "pages": [
4 | "entrypoints",
5 | "config",
6 | "routing",
7 | "client",
8 | "server"
9 | ]
10 | }
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/google-cloud-container-registry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/google-cloud-container-registry.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/deployment/google-cloud-project-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/deployment/google-cloud-project-dashboard.png
--------------------------------------------------------------------------------
/src/routes/solid-meta/getting-started/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Getting started",
3 | "pages": [
4 | "installation-and-setup.mdx",
5 | "client-setup.mdx",
6 | "server-setup.mdx"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/entrypoints/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Entrypoints",
3 | "pages": [
4 | "app-config.mdx",
5 | "app.mdx",
6 | "entry-client.mdx",
7 | "entry-server.mdx"
8 | ]
9 | }
--------------------------------------------------------------------------------
/public/images/how-to-guides/comparison/react/react-simple-state-update-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/comparison/react/react-simple-state-update-dark.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/comparison/react/solid-simple-state-update-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/comparison/react/solid-simple-state-update-dark.png
--------------------------------------------------------------------------------
/src/routes/solid-start/guides/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Guides",
3 | "pages": [
4 | "security.mdx",
5 | "data-fetching.mdx",
6 | "data-mutation.mdx",
7 | "service-workers.mdx"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/public/images/how-to-guides/comparison/react/react-simple-state-update-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/comparison/react/react-simple-state-update-light.png
--------------------------------------------------------------------------------
/public/images/how-to-guides/comparison/react/solid-simple-state-update-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs/solid-docs/HEAD/public/images/how-to-guides/comparison/react/solid-simple-state-update-light.png
--------------------------------------------------------------------------------
/src/routes/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "root",
3 | "pages": [
4 | "index.mdx",
5 | "quick-start.mdx",
6 | "concepts",
7 | "advanced-concepts",
8 | "guides",
9 | "configuration"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/routes/solid-start/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "root",
3 | "pages": [
4 | "index.mdx",
5 | "getting-started.mdx",
6 | "building-your-application",
7 | "advanced",
8 | "guides"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Reference",
3 | "pages": [
4 | "components",
5 | "data-apis",
6 | "preload-functions",
7 | "primitives",
8 | "response-helpers"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/src/routes/reference/basic-reactivity/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Basic reactivity",
3 | "pages": [
4 | "create-effect.mdx",
5 | "create-memo.mdx",
6 | "create-resource.mdx",
7 | "create-signal.mdx"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Meta reference",
3 | "pages": [
4 | "title.mdx",
5 | "link.mdx",
6 | "meta.mdx",
7 | "style.mdx",
8 | "base.mdx",
9 | "metaprovider.mdx"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/middleware/index.ts:
--------------------------------------------------------------------------------
1 | import { createMiddleware } from "@solidjs/start/middleware";
2 | import { handleLegacyRoutes } from "./legacy-routes-redirect";
3 |
4 | export default createMiddleware({
5 | onRequest: [handleLegacyRoutes],
6 | });
7 |
--------------------------------------------------------------------------------
/src/routes/reference/component-apis/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Component APIs",
3 | "pages": [
4 | "children.mdx",
5 | "create-context.mdx",
6 | "create-unique-id.mdx",
7 | "lazy.mdx",
8 | "use-context.mdx"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/src/routes/guides/styling-components/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Styling your Components",
3 | "pages": [
4 | "sass.mdx",
5 | "less.mdx",
6 | "css-modules.mdx",
7 | "macaron.mdx",
8 | "tailwind.mdx",
9 | "uno.mdx"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/routes/solid-router/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "root",
3 | "pages": [
4 | "index.mdx",
5 | "getting-started",
6 | "concepts",
7 | "rendering-modes",
8 | "data-fetching",
9 | "advanced-concepts",
10 | "guides"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/components/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Components",
3 | "pages": [
4 | "a.mdx",
5 | "hash-router.mdx",
6 | "memory-router.mdx",
7 | "navigate.mdx",
8 | "route.mdx",
9 | "router.mdx"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/routes/solid-start/advanced/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Advanced",
3 | "pages": [
4 | "middleware.mdx",
5 | "session.mdx",
6 | "request-events.mdx",
7 | "return-responses.mdx",
8 | "auth.mdx",
9 | "websocket.mdx"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/routes/concepts/control-flow/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Control flow",
3 | "pages": [
4 | "conditional-rendering.mdx",
5 | "dynamic.mdx",
6 | "list-rendering.mdx",
7 | "portal.mdx",
8 | "error-boundary.mdx"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/src/routes/reference/store-utilities/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Store utilities",
3 | "pages": [
4 | "create-mutable.mdx",
5 | "create-store.mdx",
6 | "modify-mutable.mdx",
7 | "produce.mdx",
8 | "reconcile.mdx",
9 | "unwrap.mdx"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/routes/reference/secondary-primitives/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Secondary primitives",
3 | "pages": [
4 | "create-computed.mdx",
5 | "create-deferred.mdx",
6 | "create-reaction.mdx",
7 | "create-render-effect.mdx",
8 | "create-selector.mdx"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/src/ui/layout/hero-code-snippet.code:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js";
2 |
3 | function Counter() {
4 | const [count, setCount] = createSignal(0);
5 |
6 | return (
7 | setCount((n) => n + 1)}
9 | >
10 | Count: {count()}
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/src/ui/layout/side-panel.tsx:
--------------------------------------------------------------------------------
1 | import { Contribute } from "./contribute";
2 | import { TableOfContents } from "./table-of-contents";
3 |
4 | export const SidePanel = () => {
5 | return (
6 |
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Rendering",
3 | "pages": [
4 | "dev.mdx",
5 | "hydrate.mdx",
6 | "hydration-script.mdx",
7 | "is-server.mdx",
8 | "render.mdx",
9 | "render-to-stream.mdx",
10 | "render-to-string-async.mdx",
11 | "render-to-string.mdx"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/ui/layout/hero-code-snippet.tsx:
--------------------------------------------------------------------------------
1 | import { highlightedCode } from "solid:hero-code-snippet";
2 | import counterTxt from "./hero-code-snippet.code?raw";
3 |
4 | export const snippetLines = counterTxt.split("\n");
5 |
6 | export default function CodeSnippet() {
7 | return
;
8 | }
9 |
--------------------------------------------------------------------------------
/src/i18n/dictionaries/index.ts:
--------------------------------------------------------------------------------
1 | import english from "./en/ui";
2 | // import ptbr from "./pt-br/ui";
3 |
4 | export const dictionaries = {
5 | default: english,
6 | // "pt-br": ptbr,
7 | };
8 |
9 | export const languages: { [key: string]: string } = {
10 | en: "English",
11 | // "pt-br": "Português do Brasil",
12 | };
13 |
--------------------------------------------------------------------------------
/src/routes/concepts/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Concepts",
3 | "pages": [
4 | "intro-to-reactivity.mdx",
5 | "understanding-jsx.mdx",
6 | "components",
7 | "signals.mdx",
8 | "control-flow",
9 | "effects.mdx",
10 | "derived-values",
11 | "context.mdx",
12 | "stores.mdx",
13 | "refs.mdx"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 | contact_links:
3 | - name: Support & Community 💁
4 | url: https://discord.com/invite/solidjs
5 | about: 'This issue tracker is not for support questions. Our Discord server hosts the community of Solid users. Come join us to discuss Solid or find assistance!'
6 |
--------------------------------------------------------------------------------
/src/routes/guides/deployment-options/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Deploying your App",
3 | "pages": [
4 | "aws-via-flightcontrol.mdx",
5 | "aws-via-sst.mdx",
6 | "cloudflare.mdx",
7 | "firebase.mdx",
8 | "netlify.mdx",
9 | "railway.mdx",
10 | "vercel.mdx",
11 | "stormkit.mdx",
12 | "zerops.mdx"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/src/routes/solid-router/concepts/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Concepts",
3 | "pages": [
4 | "navigation.mdx",
5 | "path-parameters.mdx",
6 | "search-parameters.mdx",
7 | "catch-all.mdx",
8 | "nesting.mdx",
9 | "layouts.mdx",
10 | "alternative-routers.mdx",
11 | "queries.mdx",
12 | "actions.mdx"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Server",
3 | "pages": [
4 | "get.mdx",
5 | "use-server.mdx",
6 | "http-header.mdx",
7 | "http-status-code.mdx",
8 | "start-server.mdx",
9 | "create-handler.mdx",
10 | "get-server-function-meta.mdx",
11 | "create-middleware.mdx"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/routes/reference/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Reference",
3 | "pages": [
4 | "basic-reactivity",
5 | "component-apis",
6 | "components",
7 | "jsx-attributes",
8 | "lifecycle",
9 | "reactive-utilities",
10 | "rendering",
11 | "secondary-primitives",
12 | "store-utilities",
13 | "server-utilities"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/data-apis/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Data APIs",
3 | "pages": [
4 | "action.mdx",
5 | "cache.mdx",
6 | "create-async.mdx",
7 | "create-async-store.mdx",
8 | "query.mdx",
9 | "revalidate.mdx",
10 | "use-action.mdx",
11 | "use-submission.mdx",
12 | "use-submissions.mdx"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/src/routes/reference/components/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Components",
3 | "pages": [
4 | "dynamic.mdx",
5 | "error-boundary.mdx",
6 | "for.mdx",
7 | "index-component.mdx",
8 | "no-hydration.mdx",
9 | "portal.mdx",
10 | "show.mdx",
11 | "switch-and-match.mdx",
12 | "suspense.mdx",
13 | "suspense-list.mdx"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "JSX attributes",
3 | "pages": [
4 | "attr.mdx",
5 | "classlist.mdx",
6 | "bool.mdx",
7 | "innerhtml.mdx",
8 | "textcontent.mdx",
9 | "on_.mdx",
10 | "on.mdx",
11 | "once.mdx",
12 | "prop.mdx",
13 | "ref.mdx",
14 | "style.mdx",
15 | "use.mdx"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/src/routes/solid-start/building-your-application/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Building your application",
3 | "pages": [
4 | "routing.mdx",
5 | "api-routes.mdx",
6 | "css-and-styling.mdx",
7 | "data-fetching.mdx",
8 | "data-mutation.mdx",
9 | "head-and-metadata.mdx",
10 | "route-prerendering.mdx",
11 | "static-assets.mdx"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/routes/guides/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Guides",
3 | "pages": [
4 | "styling-your-components.mdx",
5 | "styling-components",
6 | "state-management.mdx",
7 | "routing-and-navigation.mdx",
8 | "complex-state-management.mdx",
9 | "fetching-data.mdx",
10 | "testing.mdx",
11 | "deploying-your-app.mdx",
12 | "deployment-options"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Primitives",
3 | "pages": [
4 | "use-before-leave.mdx",
5 | "use-is-routing.mdx",
6 | "use-location.mdx",
7 | "use-match.mdx",
8 | "use-navigate.mdx",
9 | "use-params.mdx",
10 | "use-search-params.mdx",
11 | "use-current-matches.mdx",
12 | "use-preload-route.mdx"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/public/scripts/browser-specific.js:
--------------------------------------------------------------------------------
1 | // add class to `html` for browser specific styles, such scrollbars
2 | if (navigator.userAgent.includes("Firefox"))
3 | document.documentElement.classList.add("firefox");
4 | // add class to `html` for platform specific styles, such scrollbars
5 | if (navigator.userAgent.includes("Windows"))
6 | document.documentElement.classList.add("windows");
7 |
--------------------------------------------------------------------------------
/scripts/collections/utils/create-dir.mjs:
--------------------------------------------------------------------------------
1 | import { existsSync } from "fs";
2 | import fs from "fs/promises";
3 | import path from "path";
4 |
5 | export async function createSolidCollectionDir() {
6 | const collectionDir = path.resolve(process.cwd(), ".solid");
7 |
8 | if (!existsSync(collectionDir)) {
9 | fs.mkdir(path.resolve(process.cwd(), ".solid"));
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "npm"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 | day: "monday"
8 | assignees:
9 | - "ladybluenotes"
10 | group:
11 | minor-patch:
12 | applies-to:
13 | -
14 | patterns:
15 | - "*"
16 | update-types:
17 | - "minor"
18 | - "patch"
19 |
--------------------------------------------------------------------------------
/public/assets/cloudflare-pages.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/app.tsx:
--------------------------------------------------------------------------------
1 | // @refresh reload
2 | import { Router } from "@solidjs/router";
3 | import { SolidBaseRoot } from "@kobalte/solidbase/client";
4 | import { FileRoutes } from "@solidjs/start/router";
5 | import "~/styles.css";
6 | import { Suspense } from "solid-js";
7 |
8 | export default function App() {
9 | return (
10 |
11 |
12 |
13 |
14 |
15 | );
16 | }
17 |
--------------------------------------------------------------------------------
/scripts/collections/utils/get-frontmatter.mjs:
--------------------------------------------------------------------------------
1 | import fs from "fs/promises";
2 | import matter from "gray-matter";
3 | /**
4 | * returns data from the frontmatter of an mdx file
5 | *
6 | * @param {string} entryPath
7 | * @returns {Promise<{ title: string; mainNavExclude?: boolean }>}
8 | */
9 | export async function getFrontMatterData(entryPath) {
10 | const file = await fs.readFile(entryPath, "utf-8");
11 |
12 | return matter(file).data;
13 | }
14 |
--------------------------------------------------------------------------------
/src/data/get-nav.tsx:
--------------------------------------------------------------------------------
1 | import { GrayMatterFile } from "gray-matter";
2 |
3 | export type Section = {
4 | type: "section";
5 | title: string;
6 | children: (Section | EntryFile)[];
7 | pages: string[];
8 | };
9 |
10 | type FrontMatter = GrayMatterFile & {
11 | data: { title: string };
12 | };
13 |
14 | export type EntryFile = {
15 | type: "markdown";
16 | path: string;
17 | slug: string;
18 | title: FrontMatter["data"]["title"];
19 | };
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/OTHER.yml:
--------------------------------------------------------------------------------
1 | name: "Other Report 🌐"
2 | title: "[Other]:"
3 | description: Report something else we should know about the docs site!
4 | labels: [
5 | "pending review"
6 | ]
7 | body:
8 | - type: textarea
9 | id: issue
10 | attributes:
11 | label: "📋 Explain your issue"
12 | description: Please describe the problem with the documentation in detail.
13 | placeholder: "..."
14 | validations:
15 | required: true
16 |
--------------------------------------------------------------------------------
/src/ui/eraser-link/eraser-link.css:
--------------------------------------------------------------------------------
1 | .eraserLinkContainer {
2 | position: absolute;
3 | top: 40px;
4 | right: 10px;
5 | height: 29px;
6 | width: 43px;
7 | transition: width 200ms ease-in-out;
8 | overflow: hidden;
9 | background-color: #fefefe;
10 | border: 1px solid #e4e4e4;
11 | border-radius: 3px;
12 | }
13 | .eraserLinkContainer:hover {
14 | width: 149px;
15 | }
16 | .eraserLinkContainer img {
17 | position: absolute;
18 | top: -1px;
19 | left: -5px;
20 | }
21 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "skipLibCheck": true,
4 | "allowSyntheticDefaultImports": true,
5 | "esModuleInterop": true,
6 | "target": "ESNext",
7 | "module": "ESNext",
8 | "moduleResolution": "Bundler",
9 | "jsxImportSource": "solid-js",
10 | "jsx": "preserve",
11 | "strict": true,
12 | "baseUrl": "./",
13 | "paths": {
14 | "~/*": ["./src/*"]
15 | },
16 | "types": ["vite/client"]
17 | },
18 | "exclude": ["node_modules"]
19 | }
20 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Reactive utilities",
3 | "pages": [
4 | "batch.mdx",
5 | "catch-error.mdx",
6 | "create-root.mdx",
7 | "from.mdx",
8 | "get-owner.mdx",
9 | "index-array.mdx",
10 | "map-array.mdx",
11 | "merge-props.mdx",
12 | "observable.mdx",
13 | "on-util.mdx",
14 | "run-with-owner.mdx",
15 | "split-props.mdx",
16 | "start-transition.mdx",
17 | "untrack.mdx",
18 | "use-transition.mdx"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/.github/actions/install/action.yml:
--------------------------------------------------------------------------------
1 | name: Install Tools & Dependencies
2 | description: Installs pnpm, Node.js & package dependencies
3 |
4 | runs:
5 | using: composite
6 | steps:
7 | - name: Setup pnpm
8 | uses: pnpm/action-setup@v4
9 | with:
10 | version: 10
11 |
12 | - name: Setup Node.js
13 | uses: actions/setup-node@v6
14 | with:
15 | node-version: 24
16 | cache: pnpm
17 |
18 | - name: Install dependencies
19 | run: pnpm install
20 | shell: bash
21 |
--------------------------------------------------------------------------------
/src/i18n/config.ts:
--------------------------------------------------------------------------------
1 | import { dictionaries } from "./dictionaries";
2 |
3 | const locales = Object.keys(dictionaries);
4 | locales.shift();
5 |
6 | /**
7 | * An array of locales
8 | * language (ISO 639-1 - set 1): https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
9 | * country code (ISO 3166-1 alpha-2): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
10 | * E.g.: Canadian French would be: `fr-ca`
11 | */
12 | export const SUPPORTED_LOCALES: string[] = locales as Array<
13 | keyof Omit
14 | >;
15 |
--------------------------------------------------------------------------------
/scripts/collections/create-flat-entry-list.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @param {Awaited>} tree
4 | * @param {object} entryMap
5 | */
6 | export function createFlatEntryList(tree, entryMap) {
7 | for (const item of tree) {
8 | if (item.type === "markdown") {
9 | if (entryMap.findIndex((e) => e.path === item.path) > -1) {
10 | console.error(`Duplicated entry found: ${item.slug}`);
11 | break;
12 | }
13 | entryMap.push(item);
14 | } else {
15 | createFlatEntryList(item.children, entryMap);
16 | }
17 | }
18 |
19 | return entryMap;
20 | }
21 |
--------------------------------------------------------------------------------
/scripts/collections/create-nav-tree.mjs:
--------------------------------------------------------------------------------
1 | import { buildFileTree } from "./build-file-tree.mjs";
2 |
3 | /**
4 | *
5 | * @param {string} rootDir
6 | * @returns
7 | */
8 | export async function createNavTree(rootDir) {
9 | const [learn, references] = await Promise.all([
10 | buildFileTree(rootDir),
11 | buildFileTree(`${rootDir}/reference`),
12 | ]);
13 |
14 | if (
15 | learn &&
16 | learn.type === "section" &&
17 | references &&
18 | references.type === "section"
19 | ) {
20 | return {
21 | reference: references.children,
22 | learn: learn.children,
23 | };
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/scripts/collections/utils/write-file.mjs:
--------------------------------------------------------------------------------
1 | import fs from "fs/promises";
2 | import path from "path";
3 | /**
4 | *
5 | * @param {string} fileName
6 | * @param {object} fileContent
7 | * @param {boolean} removeAsConst
8 | * @param {string} collectionDir
9 | */
10 | export async function writeFile(
11 | fileName,
12 | fileContent,
13 | removeAsConst = false,
14 | collectionDir = ".solid"
15 | ) {
16 | return fs.writeFile(
17 | path.resolve(collectionDir, fileName),
18 | `export default ${JSON.stringify(fileContent, null, 2)} ${
19 | removeAsConst ? "" : "as const"
20 | }`
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/src/i18n/translator.ts:
--------------------------------------------------------------------------------
1 | import { dictionaries } from "./dictionaries";
2 | import { SUPPORTED_LOCALES } from "./config";
3 |
4 | export function createTranslator(
5 | locale: (typeof SUPPORTED_LOCALES)[number] | null
6 | ) {
7 | // type overlap will only be 100% when translations are done
8 | // so we're fine with `dictionaries[locale][key]` being implicit `any`
9 | // @ts-expect-error: expected any here
10 | const dictionary = dictionaries[locale || "default"];
11 | return (key: keyof (typeof dictionaries)["default"]) => {
12 | return dictionary[key] || dictionaries["default"][key];
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/scripts/collections/schemas.mjs:
--------------------------------------------------------------------------------
1 | import { z } from "zod";
2 |
3 | export const pages = z.array(z.string());
4 |
5 | export const sectionSchema = z.object({
6 | type: z.literal("section"),
7 | title: z.string(),
8 | // children: z.array(z.string()),
9 | pages,
10 | });
11 | export const entrySchema = z.object({
12 | type: z.literal("markdown"),
13 | path: z.string(),
14 | slug: z.string(),
15 | titles: z.string(),
16 | });
17 |
18 | export const sectionData = z.object({
19 | title: z.string(),
20 | pages,
21 | });
22 |
23 | export const frontMatterSchema = z.object({
24 | title: z.string(),
25 | });
26 |
--------------------------------------------------------------------------------
/.kodiak.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | [merge]
4 | automerge_label = "automerge"
5 | delete_branch_on_merge = true
6 | merge_method = "squash"
7 |
8 | [merge.message]
9 | title= "pull_request_title"
10 | include_pull_request_author = true
11 | include_coauthors = true
12 | include_pr_number= true
13 | include_pull_request_url = true
14 | body = "pull_request_body"
15 |
16 | # once we have Renovate and CI checks
17 | # [merge.automerge_dependencies]
18 | # versions = ["minor", "patch"]
19 | # usernames = ["renovate"]
20 |
21 | [update]
22 | # ignored_usernames = ["renovate"]
23 | require_automerge_label = false
24 | always = true
25 |
--------------------------------------------------------------------------------
/public/assets/tailwind.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module "solid:collection" {
2 | import coreTree from ".solid/tree";
3 | import startTree from ".solid/solid-router-tree";
4 | import routerTree from ".solid/solid-start-tree";
5 | import metaTree from ".solid/solid-meta-tree";
6 | import coreEntries from ".solid/flat-entries";
7 | import routerEntries from ".solid/solid-start-flat-entries";
8 | import startEntries from ".solid/solid-router-flat-entries";
9 | import metaEntries from ".solid/solid-meta-flat-entries";
10 |
11 | export {
12 | coreEntries,
13 | routerEntries,
14 | startEntries,
15 | metaEntries,
16 | coreTree,
17 | routerTree,
18 | startTree,
19 | metaTree,
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/src/routes/reference/store-utilities/unwrap.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: unwrap
3 | use_cases: >-
4 | raw data access, proxy removal, debugging, third-party integration, data
5 | serialization
6 | tags:
7 | - store
8 | - proxy
9 | - data
10 | - debugging
11 | - utilities
12 | version: '1.0'
13 | description: >-
14 | Extract raw data from Solid stores without proxy wrapping. Essential for
15 | debugging, serialization, or third-party integrations.
16 | ---
17 |
18 | `unwrap` returns the underlying data in the store without a proxy.
19 |
20 | ```tsx
21 | import { unwrap } from "solid-js/store"
22 | import type { Store } from "solid-js/store"
23 |
24 | function unwrap(store: Store): T
25 | ```
26 |
--------------------------------------------------------------------------------
/public/assets/netlify.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/client/start-client.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: StartClient
3 | use_cases: 'client entry setup, app wrapper configuration, root component setup'
4 | tags:
5 | - client
6 | - entry
7 | - components
8 | - configuration
9 | version: '1.0'
10 | description: >-
11 | StartClient component wraps your SolidStart application root. Essential for
12 | proper client-side initialization and mounting.
13 | ---
14 |
15 | `StartClient` is a component that wraps the application root.
16 | It can be passed to [`mount`](/solid-start/reference/client/start-client) in the [`entry-client.tsx`](/solid-start/reference/entrypoints/entry-client).
17 |
18 | ```tsx
19 | import { StartClient } from "@solidjs/start/client";
20 | ```
21 |
--------------------------------------------------------------------------------
/env.d.ts:
--------------------------------------------------------------------------------
1 | interface ImportMetaEnv {
2 | readonly VITE_ORAMA_ENDPOINT: string;
3 | readonly VITE_ORAMA_API_KEY: string;
4 | readonly VITE_ORAMA_SECURE_PROXY: string;
5 | }
6 |
7 | interface ImportMeta {
8 | readonly env: ImportMetaEnv;
9 | }
10 |
11 | declare namespace NodeJS {
12 | interface ProcessEnv {
13 | readonly ORAMA_PROJECT_ID: string;
14 | readonly ORAMA_DATASOURCE_ID: string;
15 | readonly ORAMA_PUBLIC_API_KEY: string;
16 | readonly ORAMA_PRIVATE_API_KEY: string;
17 | }
18 | }
19 |
20 | declare module "solid:collection" {
21 | // eslint-disable-next-line
22 | const component: any;
23 | export default component;
24 | }
25 |
26 | declare module "solid:hero-code-snippet" {
27 | export const highlightedCode: string;
28 | }
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/
2 | coverage/
3 | types/
4 |
5 | # only pnpm lockfile is versioned
6 | # so Netlify can infer correctly everytime.
7 | yarn.lock
8 | package-lock.json
9 | bun.lockb
10 |
11 | .turbo
12 |
13 | packages/create-solid/bin
14 | *.log
15 |
16 | dist
17 | worker
18 | .solid
19 |
20 | # dependencies
21 | node_modules
22 |
23 | # IDEs and editors
24 | .idea
25 | .project
26 | .classpath
27 | *.launch
28 | .settings/
29 |
30 | # Temp
31 | gitignore
32 |
33 | .env
34 |
35 | # System Files
36 | .DS_Store
37 | Thumbs.db
38 | # Local Netlify folder
39 | .netlify
40 | # Netlify build dir
41 | netlify
42 | /test-results/
43 | /playwright-report/
44 | /playwright/.cache/
45 |
46 | .solid
47 | .vinxi
48 |
49 | public/sitemap.xml
50 | public/i18n-status
51 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/start-transition.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: startTransition
3 | use_cases: >-
4 | async updates, performance optimization, non-blocking updates, transition
5 | control
6 | tags:
7 | - transitions
8 | - async
9 | - performance
10 | - updates
11 | - batching
12 | version: '1.0'
13 | description: >-
14 | Start transitions in SolidJS without pending state tracking. Batch async
15 | updates for improved performance and smoother user interactions.
16 | ---
17 |
18 | ```ts
19 | import { startTransition } from "solid-js"
20 |
21 | function startTransition: (fn: () => void) => Promise
22 |
23 | ```
24 |
25 | Similar to `useTransition` except there is no associated pending state.
26 | This one can just be used directly to start the Transition.
27 |
--------------------------------------------------------------------------------
/src/ui/not-found.tsx:
--------------------------------------------------------------------------------
1 | import { Title } from "@solidjs/meta";
2 | import { Layout } from "./layout";
3 | import { HttpStatusCode } from "@solidjs/start";
4 | import { A } from "~/ui/i18n-anchor";
5 | import { useProjectTitle } from "./use-project";
6 |
7 | export function NotFound() {
8 | const projectTitle = useProjectTitle();
9 |
10 | return (
11 | <>
12 | Not Found - {projectTitle()}
13 |
14 |
15 |
21 |
22 | >
23 | );
24 | }
25 |
--------------------------------------------------------------------------------
/public/assets/uno.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | - [ ] I have read the [Contribution guide](https://github.com/solidjs/solid-docs/blob/main/CONTRIBUTING.md)
4 | - [ ] This PR references an issue (except for typos, broken links, or other minor problems)
5 |
6 | ### Description(required)
7 |
8 |
9 | ### Related issues & labels
10 |
11 | - Closes #
12 | - Suggested label(s) (optional):
13 |
--------------------------------------------------------------------------------
/src/ui/edit-page-link.tsx:
--------------------------------------------------------------------------------
1 | import { Component, Show } from "solid-js";
2 | import { Icon } from "solid-heroicons";
3 | import { pencilSquare } from "solid-heroicons/outline";
4 | import { useCurrentPageData } from "@kobalte/solidbase/client";
5 |
6 | import { useI18n } from "~/i18n/i18n-context";
7 |
8 | export const EditPageLink: Component = () => {
9 | const i18n = useI18n();
10 | const data = useCurrentPageData();
11 |
12 | return (
13 |
14 | {(editLink) => (
15 |
20 |
21 | {i18n.t("contribute.edit")}
22 |
23 | )}
24 |
25 | );
26 | };
27 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/metaprovider.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: MetaProvider
3 | order: 6
4 | use_cases: >-
5 | initializing meta tags, wrapping app, head management setup, meta context,
6 | always in meta apps
7 | tags:
8 | - provider
9 | - meta
10 | - setup
11 | - context
12 | - wrapper
13 | - head
14 | version: '1.0'
15 | description: >-
16 | MetaProvider wraps your Solid app to enable head tag management. Essential
17 | parent component for all metadata components to function properly.
18 | ---
19 |
20 | `MetaProvider` is a parent component responsible for wrapping all the metadata components.
21 | All components that are contained within this will be added to the application ` `
22 |
23 | ```tsx twoslash
24 | import { MetaProvider } from "@solidjs/meta";
25 |
26 | // add meta components ;
27 | ```
28 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/innerhtml.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: innerHTML
3 | use_cases: >-
4 | rendering html strings, dynamic html content, third-party html, legacy content
5 | migration, sanitized markup
6 | tags:
7 | - html
8 | - dom
9 | - security
10 | - content
11 | - markup
12 | version: '1.0'
13 | description: >-
14 | Set raw HTML content in SolidJS elements using innerHTML attribute and render
15 | HTML strings dynamically.
16 | ---
17 |
18 | The `innerHTML` attribute is equivalent to the [`innerHTML` DOM property](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML).
19 | This attribute replaces all existing nodes of the element with new nodes generated by parsing the provided string as HTML.
20 |
21 | :::caution
22 |
23 | Using `innerHTML` with unsanitized user-supplied data can introduce security vulnerabilities.
24 |
25 | :::
26 |
--------------------------------------------------------------------------------
/src/i18n/helpers.ts:
--------------------------------------------------------------------------------
1 | import { useLocation, useMatch } from "@solidjs/router";
2 | import { useCurrentRouteMetaData } from "~/utils/route-metadata-helper";
3 | import { SUPPORTED_LOCALES } from "./config";
4 |
5 | export function getCurrentLocale() {
6 | const match = useMatch(() => "/:locale?/*", {
7 | locale: SUPPORTED_LOCALES,
8 | });
9 | return match()?.params.project ?? null;
10 | }
11 |
12 | export function getEntryFileName() {
13 | const pathname = useLocation().pathname;
14 | const currentRouteMetaData = useCurrentRouteMetaData();
15 |
16 | if (currentRouteMetaData.isProjectRoot) {
17 | return `${pathname}/index.mdx`.replace("//", "/");
18 | } else {
19 | // Trim trailing slash
20 | return (pathname.endsWith("/") ? pathname.slice(0, -1) : pathname) + ".mdx";
21 | }
22 | }
23 |
24 | export const isExternalURL = (url: string) => /^https?:\/\//.test(url);
25 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/catch-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: catchError
3 | use_cases: >-
4 | error handling, error boundaries, exception management, debugging, graceful
5 | error recovery
6 | tags:
7 | - errors
8 | - debugging
9 | - exceptions
10 | - handlers
11 | version: '1.0'
12 | description: >-
13 | Wrap SolidJS code with error handlers to catch and handle exceptions
14 | gracefully. Create error boundaries for robust error management in components.
15 | ---
16 |
17 | :::note
18 | New in v1.7.0
19 | :::
20 |
21 | ```tsx
22 | import { catchError } from "solid-js"
23 |
24 | function catchError(tryFn: () => T, onError: (err: any) => void): T
25 | ```
26 |
27 | Wraps a `tryFn` with an error handler that fires if an error occurs below that point.
28 | Only the nearest scope error handlers execute.
29 | Rethrow to trigger up the line.
30 |
--------------------------------------------------------------------------------
/src/ui/button-link.tsx:
--------------------------------------------------------------------------------
1 | import { A, type RouterLinkProps } from "./i18n-anchor";
2 |
3 | type ButtonLinkProps = RouterLinkProps & {
4 | variant: "primary" | "secondary";
5 | };
6 |
7 | export const ButtonLink = (props: ButtonLinkProps) => {
8 | return (
9 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/src/entry-server.tsx:
--------------------------------------------------------------------------------
1 | import { createHandler, StartServer } from "@solidjs/start/server";
2 |
3 | export default createHandler(() => (
4 | {
6 | return (
7 |
8 |
9 |
10 |
14 |
15 |
20 |
21 | {assets}
22 |
23 |
24 | {children}
25 | {scripts}
26 |
27 |
28 | );
29 | }}
30 | />
31 | ));
32 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/prop.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'prop:*'
3 | order: 6
4 | use_cases: >-
5 | dom properties, scrolltop manipulation, custom properties, property vs
6 | attribute, direct property access
7 | tags:
8 | - properties
9 | - dom
10 | - attributes
11 | - manipulation
12 | - custom
13 | version: '1.0'
14 | description: >-
15 | Force DOM property assignment with prop:* in SolidJS. Set properties directly
16 | instead of attributes for specific DOM manipulation needs.
17 | ---
18 |
19 | Forces the prop to be treated as a property instead of an attribute.
20 |
21 | ```tsx
22 |
23 | ```
24 |
25 | :::note[Strong-Typing Custom Properties]
26 | Type definitions are required when using TypeScript.
27 | See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
28 | :::
29 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-is-routing.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useIsRouting
3 | use_cases: >-
4 | loading states, transition indicators, pending ui, stale content, concurrent
5 | rendering feedback
6 | tags:
7 | - loading
8 | - transition
9 | - pending
10 | - state
11 | - ui
12 | version: '1.0'
13 | description: >-
14 | Track route transitions with useIsRouting - display loading states, pending
15 | UI, and transition feedback during navigation in SolidJS.
16 | ---
17 |
18 | Retrieves a signal that indicates whether the route is currently in a transition.
19 | This is useful for showing a stale or pending state when the route resolution is suspended state during concurrent rendering.
20 |
21 | ```js
22 | const isRouting = useIsRouting();
23 |
24 | return (
25 |
26 |
27 |
28 | );
29 | ```
30 |
--------------------------------------------------------------------------------
/src/solidbase-theme/Layout.tsx:
--------------------------------------------------------------------------------
1 | import { RouteSectionProps } from "@solidjs/router";
2 | import { ErrorBoundary } from "solid-js";
3 |
4 | import { Layout } from "~/ui/layout";
5 | import { NotFound } from "~/ui/not-found";
6 | import { I18nProvider } from "~/i18n/i18n-context";
7 | import { useThemeListener } from "@kobalte/solidbase/client";
8 | import { usePace } from "@kobalte/solidbase/default-theme/pace.js";
9 | import { Title } from "@solidjs/meta";
10 | import { useProjectTitle } from "~/ui/use-project";
11 |
12 | export default function (props: RouteSectionProps) {
13 | useThemeListener();
14 | usePace();
15 | const projectTitle = useProjectTitle();
16 |
17 | return (
18 |
19 | {projectTitle()}
20 | }>
21 | {props.children}
22 |
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-current-matches.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useCurrentMatches
3 | use_cases: >-
4 | breadcrumbs, route metadata, nested routes, navigation menus, route info
5 | extraction
6 | tags:
7 | - routes
8 | - breadcrumbs
9 | - matches
10 | - navigation
11 | - metadata
12 | version: '1.0'
13 | description: >-
14 | Access all matched route information with useCurrentMatches - build
15 | breadcrumbs, extract route metadata, and navigate nested routes.
16 | ---
17 |
18 | `useCurrentMatches` returns all the matches for the current matched route. Useful for getting all the route information.
19 |
20 | For example if you stored breadcrumbs on your route definition you could retrieve them like so:
21 |
22 | ```js
23 | const matches = useCurrentMatches();
24 | const breadcrumbs = createMemo(() =>
25 | matches().map((m) => m.route.info.breadcrumb)
26 | );
27 | ```
28 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/attr.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'attr:*'
3 | use_cases: >-
4 | web components, custom elements, forcing attributes, html attributes, dom
5 | properties
6 | tags:
7 | - attributes
8 | - web-components
9 | - dom
10 | - props
11 | - typescript
12 | - custom-elements
13 | version: '1.0'
14 | description: >-
15 | Force props as HTML attributes instead of properties in SolidJS. Essential for
16 | Web Components and custom element attribute handling.
17 | ---
18 |
19 | Forces the prop to be treated as an attribute instead of a property.
20 | Useful for Web Components where you want to set attributes.
21 |
22 | ```tsx
23 |
24 | ```
25 |
26 | :::note[Strong-Typing Custom Attributes]
27 | Type definitions are required when using TypeScript.
28 | See the[TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
29 | :::
30 |
--------------------------------------------------------------------------------
/src/ui/layout/contribute.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from "solid-js";
2 | import { useI18n } from "~/i18n/i18n-context";
3 | import { EditPageLink } from "../edit-page-link";
4 | import { PageIssueLink } from "../page-issue-link";
5 |
6 | export const Contribute: Component = () => {
7 | const i18n = useI18n();
8 |
9 | return (
10 | <>
11 |
12 | {i18n.t("contribute.title")}
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | >
30 | );
31 | };
32 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/textcontent.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: textContent
3 | use_cases: >-
4 | text-only content, performance optimization, plain text rendering, avoiding
5 | html parsing, simple text updates
6 | tags:
7 | - text
8 | - performance
9 | - content
10 | - optimization
11 | - dom
12 | version: '1.0'
13 | description: >-
14 | Optimize text rendering with textContent in SolidJS. Bypass diffing for
15 | text-only content and improve performance for simple text updates.
16 | ---
17 |
18 | The `textContent` attribute is equivalent to the [`textContent` DOM property](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).
19 | This attribute replaces all existing child nodes of the element with a single text node containing the provided string.
20 |
21 | Using `textContent` can improve performance when the element's children are known to be exclusively text, as it bypasses the generic diffing process.
22 |
--------------------------------------------------------------------------------
/src/i18n/dictionaries/pt-br/ui.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | //hero
3 | "hero.title": "UIs com Fine-Grained Reactivity, sem esforço.",
4 | "hero.subtitle": "Solid é um framework JavaScript moderno para a web atual.",
5 | "hero.button.primary": "Comece agora",
6 | "hero.button.secondary": "Junte-se à comunidade",
7 |
8 | // main navigation
9 | "main.nav.tab.learn": "Aprenda",
10 | "main.nav.tab.reference": "Referência",
11 | "main.nav.section.concepts": "Conceitos",
12 | "main.nav.section.components": "Componentes",
13 |
14 | // ToC
15 | "toc.this.page": "Nesta página",
16 | "toc.overview": "Sumário",
17 | "contribute.title": "Contribua",
18 | "contribute.edit": "Edite este artigo",
19 | "contribute.report": "Reporte um erro neste artigo",
20 |
21 | // pagination
22 | "pagination.next": "Próximo",
23 | "pagination.previous": "Anterior",
24 |
25 | // 404
26 | "missing.translation": "Esta seção ainda não foi traduzida",
27 | } as const;
28 |
--------------------------------------------------------------------------------
/scripts/generateSitemap.js:
--------------------------------------------------------------------------------
1 | import { SitemapStream, streamToPromise } from "sitemap";
2 | import { Readable } from "stream";
3 | import entries from "../.solid/entriesList.js";
4 | import fs from "fs";
5 |
6 | const generateLinkArray = (routes) => {
7 | return routes.reduce((acc, route) => {
8 | return [
9 | ...acc,
10 | { url: route, priority: route == "/" ? 1 : 0.7, changefreq: "weekly" },
11 | ];
12 | }, []);
13 | };
14 |
15 | (async () => {
16 | const referencesRoutes = entries.reference.map(({ path }) => path);
17 | const learnRoutes = entries.learn.map(({ path }) => path);
18 | const links = [
19 | ...generateLinkArray(learnRoutes),
20 | ...generateLinkArray(referencesRoutes),
21 | ];
22 | const stream = new SitemapStream({ hostname: "https://docs.solidjs.com/" });
23 | return streamToPromise(Readable.from(links).pipe(stream)).then((data) =>
24 | fs.writeFileSync("public/sitemap.xml", data, { encoding: "utf-8" })
25 | );
26 | })();
27 |
--------------------------------------------------------------------------------
/src/styles/prism.css:
--------------------------------------------------------------------------------
1 | pre[class*="language-"] {
2 | color: theme("colors.slate.50");
3 | }
4 |
5 | .token.tag,
6 | .token.class-name,
7 | .token.selector,
8 | .token.selector .class,
9 | .token.selector.class,
10 | .token.function {
11 | color: theme("colors.pink.400");
12 | }
13 |
14 | .token.attr-name,
15 | .token.keyword,
16 | .token.rule,
17 | .token.pseudo-class,
18 | .token.important {
19 | color: theme("colors.slate.300");
20 | }
21 |
22 | .token.module {
23 | color: theme("colors.pink.400");
24 | }
25 |
26 | .token.attr-value,
27 | .token.class,
28 | .token.string,
29 | .token.property {
30 | color: theme("colors.sky.300");
31 | }
32 |
33 | .token.punctuation,
34 | .token.attr-equals {
35 | color: theme("colors.slate.500");
36 | }
37 |
38 | .token.unit,
39 | .language-css .token.function {
40 | color: theme("colors.teal.200");
41 | }
42 |
43 | .token.comment,
44 | .token.operator,
45 | .token.combinator {
46 | color: theme("colors.slate.400");
47 | }
48 |
--------------------------------------------------------------------------------
/.github/workflows/static_checks.yml:
--------------------------------------------------------------------------------
1 | name: 🔍 Lint / Type Checks
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 | branches:
9 | - main
10 |
11 | permissions:
12 | contents: read
13 | actions: read
14 | security-events: read
15 |
16 | jobs:
17 | typecheck:
18 | runs-on: ubuntu-latest
19 | steps:
20 | - name: Check out code
21 | uses: actions/checkout@v4
22 |
23 | - name: Install tools & dependencies
24 | uses: ./.github/actions/install
25 |
26 | - name: Generate virtual modules
27 | run: pnpm sync
28 |
29 | - name: TypeScript check
30 | run: pnpm check:types
31 |
32 | lint:
33 | runs-on: ubuntu-latest
34 | steps:
35 | - name: Check out code
36 | uses: actions/checkout@v4
37 |
38 | - name: Install tools & dependencies
39 | uses: ./.github/actions/install
40 |
41 | - name: Lint code
42 | run: pnpm check:lint
43 |
--------------------------------------------------------------------------------
/.github/workflows/orama_sync.yml:
--------------------------------------------------------------------------------
1 | name: Sync Orama
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches:
7 | - main
8 | paths:
9 | - "**.mdx"
10 |
11 | permissions:
12 | contents: read
13 | pull-requests: read
14 |
15 | jobs:
16 | build:
17 | runs-on: ubuntu-latest
18 | steps:
19 | - name: Checkout repository
20 | uses: actions/checkout@v4
21 | - uses: pnpm/action-setup@v4
22 | with:
23 | version: 10
24 | - name: Setup Node.js
25 | uses: actions/setup-node@v4
26 | with:
27 | node-version: 24.x
28 | cache: pnpm
29 | - name: Install dependencies
30 | run: pnpm i
31 | - name: Sync Orama
32 | run: pnpm sync:orama
33 | env:
34 | ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }}
35 | ORAMA_DATASOURCE_ID: ${{ secrets.ORAMA_DATASOURCE_ID }}
36 | ORAMA_PROJECT_ID: ${{ secrets.ORAMA_PROJECT_ID }}
37 |
--------------------------------------------------------------------------------
/public/assets/stormkit.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/getting-started/client-setup.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Client setup
3 | order: 2
4 | use_cases: >-
5 | seo, meta tags, document head management, social media tags, page titles,
6 | canonical urls
7 | tags:
8 | - meta
9 | - seo
10 | - head
11 | - client
12 | - tags
13 | version: '1.0'
14 | description: >-
15 | Manage document head tags in Solid apps. Add titles, meta tags, and links
16 | dynamically for better SEO and social media sharing.
17 | ---
18 |
19 | You can inject a tag into the ` ` by rendering one of the head tag components when necessary.
20 | No special requirements are needed on the client side.
21 |
22 | ```js
23 | import { MetaProvider, Title, Link, Meta } from "@solidjs/meta";
24 |
25 | const App = () => (
26 |
27 |
28 |
Title of page
29 |
30 |
31 | // ...
32 |
33 |
34 | );
35 | ```
36 |
--------------------------------------------------------------------------------
/public/assets/railway.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Overview
3 | mainNavExclude: true
4 | use_cases: >-
5 | managing head tags, seo optimization, document metadata, dynamic meta tags,
6 | ssr meta management
7 | tags:
8 | - meta
9 | - head
10 | - seo
11 | - ssr
12 | - overview
13 | version: '1.0'
14 | description: >-
15 | Solid Meta provides asynchronous SSR-ready document head management. Define
16 | meta tags at any component level for flexible SEO and metadata control.
17 | ---
18 |
19 | # Overview
20 |
21 | Solid Meta offers asynchronous SSR-ready Document Head management for Solid Applications, based on [React Head](https://github.com/tizmagik/react-head)
22 |
23 | With Solid Meta, you can define `document.head` tags at any level of your component hierarchy.
24 | This helps you to manage tags conveniently, especially when contextual information for specific tags are buried deep within your component hierarchy.
25 |
26 | This library has no dependencies and is designed to seamlessly integrate with asynchronous rendering.
27 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/is-server.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: isServer
3 | use_cases: >-
4 | conditional rendering, ssr vs client code, bundle optimization,
5 | environment-specific logic, code splitting
6 | tags:
7 | - ssr
8 | - environment
9 | - bundling
10 | - optimization
11 | - conditional
12 | version: '1.0'
13 | description: >-
14 | Detect server or browser environment with isServer. Optimize bundle sizes by
15 | conditionally including code for specific runtime environments.
16 | ---
17 |
18 | ```ts
19 | import { isServer } from "solid-js/web"
20 |
21 | const isServer: boolean
22 |
23 | ```
24 |
25 | This indicates that the code is being run as the server or browser bundle.
26 | As the underlying runtimes export this as a constant boolean it allows bundlers to eliminate the code and their used imports from the respective bundles.
27 |
28 | ```ts
29 | import { isServer } from "solid-js/web";
30 |
31 | if (isServer) {
32 | // I will never make it to the browser bundle
33 | } else {
34 | // won't be run on the server;
35 | }
36 | ```
37 |
--------------------------------------------------------------------------------
/scripts/collections/utils/get-dir-data.mjs:
--------------------------------------------------------------------------------
1 | import fs from "fs/promises";
2 | import path from "path";
3 | import { sectionData } from "../schemas.mjs";
4 | import { languages } from "../index.mjs";
5 |
6 | /**
7 | *
8 | * @param {string} path
9 | */
10 | function formatDirPath(path) {
11 | for (const lang of languages) {
12 | if (path.includes(lang)) {
13 | return path.replace("/" + lang, "");
14 | }
15 | }
16 |
17 | return path;
18 | }
19 |
20 | export async function getDirData(dirPath = process.cwd()) {
21 | const dir = formatDirPath(dirPath);
22 | try {
23 | const data = JSON.parse(
24 | await fs.readFile(path.resolve(dir, "data.json"), "utf-8")
25 | );
26 |
27 | if (!sectionData.safeParse(data).success) {
28 | // throw new Error("failed to parse")
29 | console.error("failed to parse::", data);
30 | }
31 |
32 | return data;
33 | } catch (e) {
34 | console.error("\n");
35 | console.error("\n");
36 | console.error(e);
37 | throw new Error(
38 | `failed to parse directory info. Does ${dir} have a data.json?`
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/i18n/i18n-context.tsx:
--------------------------------------------------------------------------------
1 | import { useMatch } from "@solidjs/router";
2 | import { type JSX, createContext, useContext } from "solid-js";
3 | import { createStore } from "solid-js/store";
4 | import { createTranslator } from "./translator";
5 | import { SUPPORTED_LOCALES } from "./config";
6 |
7 | type ProviderProps = { children: JSX.Element };
8 |
9 | const initialI18nStore = {
10 | get t() {
11 | const match = useMatch(() => "/:locale?/*", {
12 | locale: SUPPORTED_LOCALES,
13 | });
14 |
15 | return createTranslator(match()?.params.project ?? null);
16 | },
17 | };
18 |
19 | export const I18nContext = createContext(initialI18nStore);
20 |
21 | export function I18nProvider(props: ProviderProps) {
22 | const [i18n] = createStore(initialI18nStore);
23 |
24 | return (
25 | {props.children}
26 | );
27 | }
28 |
29 | export function useI18n() {
30 | const context = useContext(I18nContext);
31 | if (!context) {
32 | throw new Error("useI18n: must be used inside ");
33 | }
34 | return context;
35 | }
36 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/title.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Title
3 | order: 1
4 | use_cases: >-
5 | page titles, seo optimization, browser tab text, dynamic titles, navigation
6 | context
7 | tags:
8 | - title
9 | - seo
10 | - head
11 | - meta
12 | - browser
13 | version: '1.0'
14 | description: >-
15 | Set dynamic page titles in your Solid app with the Title component. Essential
16 | for SEO and providing context in browser tabs and bookmarks.
17 | ---
18 |
19 | `Title` is a component that renders the [`title`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title) element.
20 | This will render the title of the page in the browser tab.
21 |
22 | ```tsx twoslash
23 | import { Title } from "@solidjs/meta";
24 | My Site ;
25 | ```
26 |
27 | ## Usage
28 |
29 | ### Setting the title for your site
30 |
31 | ```tsx twoslash title="root.tsx" {5}
32 | import { MetaProvider, Title } from "@solidjs/meta";
33 | export default function Root() {
34 | return (
35 |
36 | Default Application Title
37 |
38 | );
39 | }
40 | ```
41 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/start-server.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: StartServer
3 | use_cases: >-
4 | server bootstrap, document setup, html structure, ssr configuration, server
5 | initialization
6 | tags:
7 | - server
8 | - bootstrap
9 | - document
10 | - ssr
11 | - initialization
12 | - html
13 | version: '1.0'
14 | description: >-
15 | Bootstrap SolidStart server with document components. Convert document
16 | functions to static HTML for server-side rendering setup.
17 | ---
18 |
19 | `StartServer` takes a function returning a document component and converts it to a static document which can be used in [`createHandler`](/solid-start/reference/server/create-handler) to bootstrap the server.
20 |
21 | ```tsx
22 | import { StartServer } from "@solidjs/start/server";
23 | ```
24 |
25 | ## Parameters
26 |
27 | | Property | Type | Description |
28 | | -------- | -------- | ----------------------------------------------------------------- |
29 | | document | Function | A function that returns the static document for your application. |
30 |
--------------------------------------------------------------------------------
/src/ui/i18n-anchor.tsx:
--------------------------------------------------------------------------------
1 | import { A as RouterAnchor, type AnchorProps } from "@solidjs/router";
2 | import { Match, Switch, splitProps } from "solid-js";
3 | import { getCurrentLocale, isExternalURL } from "~/i18n/helpers";
4 |
5 | export type RouterLinkProps = AnchorProps & {
6 | addLocale?: boolean;
7 | };
8 |
9 | export function A(props: RouterLinkProps) {
10 | const locale = () => getCurrentLocale();
11 | const external = () => isExternalURL(props.href);
12 |
13 | const [_, rest] = splitProps(props, ["addLocale"]);
14 |
15 | return (
16 | }>
17 |
18 | {(loc) => (
19 |
29 | )}
30 |
31 |
32 |
33 |
34 |
35 | );
36 | }
37 |
--------------------------------------------------------------------------------
/src/routes/solid-start/guides/service-workers.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Service workers
3 | use_cases: >-
4 | offline support, pwa, caching, background sync, push notifications,
5 | performance optimization
6 | tags:
7 | - service-workers
8 | - pwa
9 | - offline
10 | - caching
11 | - performance
12 | version: '1.0'
13 | description: >-
14 | Register and configure service workers in SolidStart for offline support,
15 | caching strategies, and progressive web app features.
16 | ---
17 |
18 | To register a service worker:
19 |
20 | 1. Place your service-worker file in the `public` directory (e.g., `public/sw.js`), making it available at the root URL (`/sw.js`).
21 | 2. Add registration logic to the `entry-client.tsx` file.
22 |
23 | ```tsx {6-11} title="src/entry-client.tsx"
24 | // @refresh reload
25 | import { mount, StartClient } from "@solidjs/start/client";
26 |
27 | mount(() => , document.getElementById("app")!);
28 |
29 | if ("serviceWorker" in navigator && import.meta.env.PROD) {
30 | window.addEventListener("load", () => {
31 | navigator.serviceWorker.register("/sw.js");
32 | });
33 | }
34 | ```
35 |
--------------------------------------------------------------------------------
/src/routes/solid-router/data-fetching/how-to/handle-error-and-loading-states.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Handle pending and error states"
3 | ---
4 |
5 | The `createAsync` primitive is designed to work with Solid's native components for managing asynchronous states.
6 | It reports its pending state to the nearest [`` boundary](/reference/components/suspense) to display loading fallbacks, and propagate errors to an [``](/reference/components/error-boundary) for handling and displaying error messages.
7 |
8 | ```tsx
9 | import { Suspense, ErrorBoundary, For } from "solid-js";
10 | import { query, createAsync } from "@solidjs/router";
11 |
12 | const getNewsQuery = query(async () => {
13 | // ... Fetches the latest news from an API.
14 | }, "news");
15 |
16 | function NewsFeed() {
17 | const news = createAsync(() => getNewsQuery());
18 |
19 | return (
20 | Could not fetch news.}>
21 | Loading news...}>
22 |
23 | {(item) => {item.headline} }
24 |
25 |
26 |
27 | );
28 | }
29 | ```
30 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/use-transition.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useTransition
3 | use_cases: >-
4 | async batching, loading states, suspense integration, concurrent updates, ui
5 | transitions
6 | tags:
7 | - transitions
8 | - async
9 | - suspense
10 | - loading
11 | - batching
12 | - concurrent
13 | version: '1.0'
14 | description: >-
15 | Batch async updates with transitions in SolidJS. Track pending states and
16 | defer commits until all async processes complete for smooth UI updates.
17 | ---
18 |
19 | ```ts
20 | import { useTransition } from "solid-js"
21 |
22 | function useTransition(): [
23 | pending: () => boolean,
24 | startTransition: (fn: () => void) => Promise
25 | ]
26 |
27 | ```
28 |
29 | Used to batch async updates in a transaction deferring commit until all async processes are complete.
30 | This is tied into Suspense and only tracks resources read under Suspense boundaries.
31 |
32 | ```ts
33 | const [isPending, start] = useTransition();
34 |
35 | // check if transitioning
36 | isPending();
37 |
38 | // wrap in transition
39 | start(() => setSignal(newValue), () => /* transition is done */)
40 | ```
41 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/entrypoints/entry-client.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: entry-client.tsx
3 | use_cases: >-
4 | browser initialization, client-only code, service workers, mounting app, spa
5 | setup
6 | tags:
7 | - entry
8 | - client
9 | - browser
10 | - initialization
11 | - mount
12 | - startup
13 | version: '1.0'
14 | description: >-
15 | Configure browser entry point for SolidStart apps. Set up client-side
16 | initialization, mount components, and register service workers.
17 | ---
18 |
19 | `entry-client.tsx` is where an application starts in the browser.
20 | It does this by passing [``](/solid-start/reference/client/start-client) and a DOM Element (the mounting point), to the [`mount`](/solid-start/reference/client/mount) function.
21 |
22 | ```tsx
23 | import { mount, StartClient } from "@solidjs/start/client";
24 |
25 | mount(() => , document.getElementById("app")!);
26 | ```
27 |
28 | This file is an ideal place to run any client specific code that is needed on startup, such as registering service workers.
29 | This is important if you are performing client-only rendering or using other modes of server-side rendering.
30 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/base.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Base
3 | order: 5
4 | use_cases: >-
5 | setting base url, relative urls, external resources, multi-page apps, cdn
6 | assets
7 | tags:
8 | - base
9 | - url
10 | - meta
11 | - head
12 | - routing
13 | version: '1.0'
14 | description: >-
15 | Set the base URL for all relative URLs in your Solid app with the Base
16 | component. Essential for apps with complex routing or external resources.
17 | ---
18 |
19 | `Base` is a component that specifies the base URL for all relative URLs in the document.
20 | This provides a way to define the [`base`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) element of your document's `head`.
21 |
22 | ```tsx twoslash
23 | import { Base } from "@solidjs/meta";
24 |
25 | ;
26 | ```
27 |
28 | ## Usage
29 |
30 | ### Adding `base` tag
31 |
32 | ```tsx twoslash
33 | import { MetaProvider, Base } from "@solidjs/meta";
34 |
35 | export default function Root() {
36 | return (
37 |
38 |
39 |
40 | );
41 | }
42 | ```
43 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/entrypoints/app-config.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: app.config.ts
3 | use_cases: 'initial setup, project configuration, build settings, deployment configuration'
4 | tags:
5 | - configuration
6 | - setup
7 | - app-config
8 | - defineconfig
9 | version: '1.0'
10 | description: >-
11 | Configure your SolidStart app with app.config.ts. Central configuration file
12 | for Vite, Vinxi, and Nitro build settings.
13 | ---
14 |
15 | The `app.config.ts` is the root of every SolidStart app and the main point of configuration.
16 | This file exports a configuration for SolidStart, [Vinxi](https://vinxi.vercel.app/), [Vite](https://vitejs.dev) and [Nitro](https://nitro.build/).
17 | The easiest way to generate a configuration is to use the [`defineConfig`](/solid-start/reference/config/define-config) helper.
18 |
19 | Here [`defineConfig`](/solid-start/reference/config/define-config) is used to create a minimal configuration with default settings.
20 |
21 | ```tsx
22 | import { defineConfig } from "@solidjs/start/config";
23 |
24 | export default defineConfig({});
25 | ```
26 |
27 | To see more configuration options, see [`defineConfig`](/solid-start/reference/config/define-config).
28 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/observable.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: observable
3 | use_cases: >-
4 | rxjs integration, observable patterns, signal interop, third-party libraries,
5 | reactive streams
6 | tags:
7 | - observables
8 | - rxjs
9 | - signals
10 | - integration
11 | - reactive
12 | - streams
13 | version: '1.0'
14 | description: >-
15 | Convert SolidJS signals to Observables for seamless integration with RxJS and
16 | other reactive libraries using the observable utility function.
17 | ---
18 |
19 | ```ts
20 | import { observable } from "solid-js"
21 |
22 | function observable(input: () => T): Observable
23 |
24 | ```
25 |
26 | This method takes a signal and produces an Observable.
27 | You can consume it from another Observable library of your choice, typically with the `from` operator.
28 |
29 | ```ts
30 | // How to integrate rxjs with a Solid signal
31 | import { observable } from "solid-js"
32 | import { from } from "rxjs"
33 |
34 | const [s, set] = createSignal(0)
35 |
36 | const obsv$ = from(observable(s))
37 |
38 | obsv$.subscribe((v) => console.log(v))
39 | ```
40 |
41 | You can also use `from` without rxjs; check out this [page](/reference/reactive-utilities/from).
42 |
--------------------------------------------------------------------------------
/src/routes/solid-router/rendering-modes/spa.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Single page applications
3 | use_cases: >-
4 | client-side routing, cdn deployment, static hosting, spa configuration,
5 | deployment setup
6 | tags:
7 | - spa
8 | - deployment
9 | - cdn
10 | - hosting
11 | - client-side
12 | - routing
13 | version: '1.0'
14 | description: >-
15 | Configure single-page applications for proper CDN and hosting deployment.
16 | Handle client-side routing without server-side rendering.
17 | ---
18 |
19 | When deploying applications that use a client-side router without relying on Server-Side Rendering, it is important that redirects to the index page are handled properly.
20 | This prevents the CDN or hosting service from returning a "not found" error when accessing URLs that do not correspond to files.
21 |
22 | Each provider has a different way of doing this.
23 | For example, Netlify provides a `_redirects` file that contains:
24 |
25 | ```sh frame="none"
26 | /* /index.html 200
27 | ```
28 |
29 | Vercel, on the other hand, requires a rewrites section in your `vercel.json`:
30 |
31 | ```json
32 | {
33 | "rewrites": [
34 | {
35 | "source": "/(.*)",
36 | "destination": "/index.html"
37 | }
38 | ]
39 | }
40 | ```
41 |
--------------------------------------------------------------------------------
/src/ui/page-issue-link.tsx:
--------------------------------------------------------------------------------
1 | import { Component, createMemo } from "solid-js";
2 | import { Icon } from "solid-heroicons";
3 | import { exclamationTriangle } from "solid-heroicons/outline";
4 | import { useI18n } from "~/i18n/i18n-context";
5 | import { getEntryFileName } from "~/i18n/helpers";
6 | import { useLocation } from "@solidjs/router";
7 |
8 | export const PageIssueLink: Component = () => {
9 | const i18n = useI18n();
10 | const location = useLocation();
11 |
12 | const srcPath = createMemo(() => {
13 | return (
14 | "https://github.com/solidjs/solid-docs-next/issues/new" +
15 | "?assignees=ladybluenotes" +
16 | "&labels=improve+documentation%2Cpending+review" +
17 | "&projects=" +
18 | "&template=CONTENT.yml" +
19 | "&title=[Content]:" +
20 | `&subject=${getEntryFileName()}` +
21 | `&page=https://docs.solidjs.com${location.pathname}`
22 | );
23 | });
24 |
25 | return (
26 |
31 |
36 | {i18n.t("contribute.report")}
37 |
38 | );
39 | };
40 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/merge-props.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: mergeProps
3 | use_cases: >-
4 | component props, default values, prop cloning, prop merging, component
5 | configuration
6 | tags:
7 | - props
8 | - components
9 | - reactivity
10 | - defaults
11 | - cloning
12 | - merging
13 | version: '1.0'
14 | description: >-
15 | Learn how to merge reactive props in SolidJS for setting component defaults,
16 | cloning props objects, and combining multiple prop sources dynamically.
17 | ---
18 |
19 | ```ts
20 | import { mergeProps } from "solid-js"
21 |
22 | function mergeProps(...sources: any): any
23 |
24 | ```
25 |
26 | A reactive object **merge** method.
27 | Useful for setting default props for components in case caller doesn't provide them.
28 | Or cloning the props object including reactive properties.
29 |
30 | This method works by using a proxy and resolving properties in reverse order.
31 | This allows for dynamic tracking of properties that aren't present when the prop object is first merged.
32 |
33 | ```ts
34 | // default props
35 | props = mergeProps({ name: "Smith" }, props)
36 |
37 | // clone props
38 | newProps = mergeProps(props)
39 |
40 | // merge props
41 | props = mergeProps(props, otherProps)
42 | ```
43 |
--------------------------------------------------------------------------------
/src/routes/reference/secondary-primitives/create-reaction.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: createReaction
3 | use_cases: >-
4 | custom tracking logic, one-time reactions, separating tracking from execution,
5 | advanced reactive patterns
6 | tags:
7 | - reactivity
8 | - tracking
9 | - custom
10 | - effects
11 | - advanced
12 | version: '1.0'
13 | description: >-
14 | Separate tracking from execution with createReaction. Create one-time reactive
15 | side effects that run on first dependency change only.
16 | ---
17 |
18 | ```ts
19 | import { createReaction } from "solid-js"
20 |
21 | function createReaction(onInvalidate: () => void): (fn: () => void) => void
22 |
23 | ```
24 |
25 | Sometimes it is useful to separate tracking from re-execution.
26 | This primitive registers a side effect that is run the first time the expression wrapped by the returned tracking function is notified of a change.
27 |
28 | ```ts
29 | const [s, set] = createSignal("start")
30 |
31 | const track = createReaction(() => console.log("something"))
32 |
33 | // run the reaction next time `s` changes.
34 | track(() => s())
35 |
36 | set("end") // "something"
37 |
38 | set("final") // no-op since the reaction only runs on the first update, need to call `track` again.
39 | ```
40 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/get-server-function-meta.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: getServerFunctionMeta
3 | use_cases: >-
4 | server function identification, parallel processing, worker management,
5 | caching, multi-core apps
6 | tags:
7 | - server
8 | - functions
9 | - metadata
10 | - parallel
11 | - workers
12 | - cache
13 | version: '1.0'
14 | description: >-
15 | Get stable IDs for server functions across parallel instances. Enable caching
16 | and state management in multi-core SolidStart apps.
17 | ---
18 |
19 | `getServerFunctionMeta` returns a function-specific id string, that is stable across all instances when server functions are run in parallel on multiple CPU cores or workers.
20 |
21 | This `id` property can and _will_ change between builds.
22 |
23 | ```tsx
24 | import { getServerFunctionMeta } from "@solidjs/start";
25 |
26 | // or some in-memory db
27 | const appCache: any = globalThis;
28 |
29 | const counter = async () => {
30 | "use server";
31 | const { id } = getServerFunctionMeta()!;
32 | const key = `counter_${id}`;
33 | appCache[key] = appCache[key] ?? 0;
34 | appCache[key]++;
35 |
36 | return appCache[key] as number;
37 | };
38 | ```
39 |
40 | ## Parameters
41 |
42 | `getServerFunctionMeta(): { id: string }`
43 |
--------------------------------------------------------------------------------
/src/ui/use-project.ts:
--------------------------------------------------------------------------------
1 | import { createRenderEffect, createSignal, type Accessor } from "solid-js";
2 | import { useMatch } from "@solidjs/router";
3 | import { SUPPORTED_LOCALES } from "~/i18n/config";
4 | import { useI18n } from "~/i18n/i18n-context";
5 |
6 | type Project = "solid-start" | "solid-router" | "solid-meta" | "solid";
7 |
8 | export function useProject(): Accessor {
9 | const match = useMatch(() => "/:locale?/:project/*", {
10 | locale: SUPPORTED_LOCALES,
11 | project: ["solid-start", "solid-router", "solid-meta"],
12 | });
13 |
14 | return () => (match()?.params.project as Project) ?? "solid";
15 | }
16 |
17 | export function useProjectTitle(): Accessor {
18 | const [title, setTitle] = createSignal("");
19 | const project = useProject();
20 | const i18n = useI18n();
21 |
22 | createRenderEffect(() => {
23 | switch (project()) {
24 | case "solid-start":
25 | setTitle(i18n.t("meta.title.solid_start"));
26 | break;
27 | case "solid-router":
28 | setTitle(i18n.t("meta.title.solid_router"));
29 | break;
30 | case "solid-meta":
31 | setTitle(i18n.t("meta.title.solid_meta"));
32 | break;
33 | default:
34 | setTitle(i18n.t("meta.title.solid"));
35 | }
36 | });
37 |
38 | return title;
39 | }
40 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/once.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: '@once'
3 | order: 5
4 | use_cases: >-
5 | performance optimization, static props, non-reactive values, compile-time
6 | optimization, reducing overhead
7 | tags:
8 | - optimization
9 | - performance
10 | - static
11 | - compiler
12 | - jsx
13 | version: '1.0'
14 | description: >-
15 | Optimize SolidJS components with @once decorator for static values. Prevent
16 | unnecessary reactive wrapping and improve runtime performance.
17 | ---
18 |
19 | Solid's compiler uses a heuristic for reactive wrapping and lazy evaluation of JSX expressions. Does it contain a function call, a property access, or JSX? If yes we wrap it in a getter when passed to components or in an effect if passed to native elements.
20 |
21 | Knowing this heuristic and its limitations, we can reduce overhead of things we know will never change by accessing them outside of the JSX. A lone variable will never be wrapped. We can also tell the compiler not to wrap them by starting the expression with a comment decorator `/* @once */`.
22 |
23 | ```tsx
24 |
25 | ```
26 |
27 | This also works on children.
28 |
29 | ```tsx
30 | {/*@once*/ state.wontUpdate}
31 | ```
32 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/bool.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'bool:*'
3 | use_cases: >-
4 | web components, custom elements, conditional attributes, boolean attributes,
5 | dynamic attribute presence
6 | tags:
7 | - attributes
8 | - web-components
9 | - boolean
10 | - conditional
11 | - dynamic
12 | version: '1.0'
13 | description: >-
14 | Control attribute presence with bool:* directive in SolidJS. Add or remove
15 | attributes dynamically based on truthy/falsy values for web components.
16 | ---
17 |
18 | `bool:*` controls the presence of an attribute in an element.
19 | When the value is `truthy` it adds the `attribute` to the element.
20 | Alternatively, when the value is `falsy` it removes the `attribute` from the element.
21 | This attribute is most useful for Web Components.
22 |
23 | ```tsx
24 |
25 | ```
26 |
27 | ```tsx
28 | // Assuming `prop.value` is `truthy`, then it becomes
29 |
30 |
31 | // And when `falsy`, then it becomes
32 |
33 |
34 | ```
35 |
36 | :::note[Strong-Typing Custom Boolean Attributes]
37 | Type definitions are required when using TypeScript.
38 | See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
39 | :::
40 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/components/navigate.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Navigate
3 | use_cases: >-
4 | automatic redirects, programmatic navigation, conditional routing, auth
5 | redirects, dynamic routing
6 | tags:
7 | - component
8 | - redirects
9 | - navigation
10 | - programmatic
11 | - dynamic
12 | version: '1.0'
13 | description: >-
14 | Navigate component provides immediate programmatic navigation and redirects,
15 | perfect for authentication flows and conditional routing logic.
16 | ---
17 |
18 | Solid Router provides a `Navigate` component that works similarly to [``](/solid-router/reference/components/a), but it will _immediately_ navigate to the provided path as soon as the component is rendered.
19 | It also uses the `href` prop, but with the additional option of passing a function to `href` that returns a path to navigate to:
20 |
21 | ```jsx
22 | function getPath({ navigate, location }) {
23 | // navigate is the result of calling useNavigate(); location is the result of calling useLocation().
24 | // You can use those to dynamically determine a path to navigate to
25 | return "/some-path";
26 | }
27 |
28 | // Navigating to /redirect will redirect you to the result of getPath
29 | } />;
30 | ```
31 |
--------------------------------------------------------------------------------
/src/routes/solid-router/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Overview
3 | use_cases: >-
4 | understanding routing, learning basics, overview needed, getting started, spa
5 | routing concepts
6 | tags:
7 | - overview
8 | - introduction
9 | - basics
10 | - spa
11 | - routing
12 | - concepts
13 | version: '1.0'
14 | description: >-
15 | Solid Router is the universal routing solution for Solid applications,
16 | enabling client and server-side navigation in single-page applications.
17 | ---
18 |
19 | # Overview
20 |
21 | :::note[Prerequisites]
22 | The docs are based on latest Solid Router.
23 | To use this version, you need to have Solid v1.8.4 or later installed.
24 | :::
25 |
26 | Solid Router is the universal router for Solid which works for rendering on the client or the server.
27 | It was inspired by and combines paradigms of [React Router](https://reactrouter.com/en/main) and the [Ember Router](https://guides.emberjs.com/release/routing/).
28 |
29 | A router provides a way to change a user's view based on the URL in the browser.
30 | This allows a "single-page" application to simulate a traditional multipage site.
31 | To use Solid Router, components called Routes that depend on the value of the URL (the "path") are specified, and the router handles the mechanism of swapping them in and out.
32 |
--------------------------------------------------------------------------------
/src/routes/solid-router/rendering-modes/ssr.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Server side rendering
3 | use_cases: >-
4 | server rendering, seo optimization, initial page load, performance
5 | optimization, data preloading
6 | tags:
7 | - ssr
8 | - server
9 | - rendering
10 | - seo
11 | - performance
12 | - preload
13 | version: '1.0'
14 | description: >-
15 | Enable server-side rendering with Solid Router for SEO and performance.
16 | Support suspense, resources, and render-as-you-fetch patterns.
17 | ---
18 |
19 | Solid Router supports all of Solid's SSR capabilities.
20 | In addition, it has Solid's transitions included, so it can be used freely with [suspense](/reference/components/suspense), [resources](/reference/basic-reactivity/create-resource), and [lazy components](/reference/component-apis/lazy).
21 |
22 | When using SSR, there is the option to use the static router directly or let the browser router default to it on the server by passing in the URL.
23 |
24 | ```jsx
25 | import { isServer } from "solid-js/web";
26 | import { Router } from "@solidjs/router";
27 |
28 | ;
29 | ```
30 |
31 | Solid Router also provides a way to define a `preload` function that loads parallel to the routes [render-as-you-fetch](https://epicreact.dev/render-as-you-fetch/).
32 |
--------------------------------------------------------------------------------
/src/routes/reference/store-utilities/produce.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: produce
3 | use_cases: >-
4 | immutable updates, immer-style mutations, store modifications, complex state
5 | changes, nested updates
6 | tags:
7 | - store
8 | - immutable
9 | - updates
10 | - immer
11 | - mutations
12 | version: '1.0'
13 | description: >-
14 | Use Immer-inspired produce API to mutate Solid stores immutably. Simplify
15 | complex nested updates with familiar mutation syntax.
16 | ---
17 |
18 | `produce` is an [Immer](https://immerjs.github.io/immer/) inspired API for Solid's Store objects that allows the store to be mutated inside the `produce` function.
19 |
20 | ```ts
21 | import { produce } from "solid-js/store"
22 | import type { NotWrappable, Store } from "solid-js/store"
23 |
24 | function produce(
25 | fn: (state: T) => void
26 | ): (
27 | state: T extends NotWrappable ? T : Store
28 | ) => T extends NotWrappable ? T : Store;
29 | ```
30 |
31 | For use with `createStore`:
32 |
33 | ```tsx
34 | import { produce } from "solid-js/store";
35 |
36 | const [state, setState] = createStore({
37 | user: {
38 | name: "John",
39 | age: 30,
40 | },
41 | list: ["book", "pen"],
42 | });
43 |
44 | setState(
45 | produce((state) => {
46 | state.user.name = "Jane";
47 | state.list.push("pencil");
48 | })
49 | );
50 | ```
51 |
--------------------------------------------------------------------------------
/public/assets/zerops.svg:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/getting-started/server-setup.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Server setup
3 | order: 3
4 | use_cases: >-
5 | ssr setup, server rendering, meta tags on server, seo optimization, initial
6 | page load
7 | tags:
8 | - ssr
9 | - server
10 | - meta
11 | - seo
12 | - setup
13 | - rendering
14 | version: '1.0'
15 | description: >-
16 | Configure server-side rendering for Solid Meta tags with MetaProvider. Learn
17 | to properly inject head tags in SSR for optimal SEO and performance.
18 | ---
19 |
20 | For server setup, wrap your application with [`MetaProvider`](/solid-meta/reference/meta/metaprovider) on the server.
21 | This component uses a `tags[]` array to pass down your head tags as part of your server-rendered payload.
22 | Once rendered on the server, the component updates this array to include the tags.
23 |
24 | ```js
25 | import { renderToString, getAssets } from "solid-js/web";
26 | import { MetaProvider } from "@solidjs/meta";
27 | import App from "./App";
28 |
29 | // ... within the context of a request ...
30 | const app = renderToString(() => (
31 |
32 |
33 |
34 | ));
35 |
36 | res.send(`
37 |
38 |
39 |
40 | ${getAssets()}
41 |
42 |
43 | ${app}
44 |
45 |
46 | `);
47 | ```
48 |
--------------------------------------------------------------------------------
/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import { Config } from "tailwindcss";
2 | import typography from "@tailwindcss/typography";
3 | import kobalte from "@kobalte/tailwindcss";
4 |
5 | export default {
6 | content: [
7 | "./src/**/*.{js,jsx,ts,tsx,md,mdx}",
8 | "./content/**/*.{js,jsx,ts,tsx,md,mdx}",
9 | ],
10 | darkMode: ["selector", "[data-theme*='dark']"],
11 | theme: {
12 | fontSize: {
13 | xs: ["0.75rem", { lineHeight: "1rem" }],
14 | sm: ["0.875rem", { lineHeight: "1.5rem" }],
15 | base: ["1rem", { lineHeight: "2rem" }],
16 | lg: ["1.125rem", { lineHeight: "1.75rem" }],
17 | xl: ["1.25rem", { lineHeight: "2rem" }],
18 | "2xl": ["1.5rem", { lineHeight: "2.5rem" }],
19 | "3xl": ["2rem", { lineHeight: "2.5rem" }],
20 | "4xl": ["2.5rem", { lineHeight: "3rem" }],
21 | "5xl": ["3rem", { lineHeight: "3.5rem" }],
22 | "6xl": ["3.75rem", { lineHeight: "1" }],
23 | "7xl": ["4.5rem", { lineHeight: "1" }],
24 | "8xl": ["6rem", { lineHeight: "1" }],
25 | "9xl": ["8rem", { lineHeight: "1" }],
26 | },
27 | extend: {
28 | fontFamily: {
29 | sans: "var(--font-geist)",
30 | display: ["var(--font-geist)", { fontFeatureSettings: "'ss01'" }],
31 | mono: "var(--font-geist-mono)",
32 | },
33 | maxWidth: {
34 | "8xl": "88rem",
35 | },
36 | },
37 | },
38 | plugins: [typography(), kobalte({ prefix: "kb" })],
39 | } satisfies Config;
40 |
--------------------------------------------------------------------------------
/eslint.config.ts:
--------------------------------------------------------------------------------
1 | import eslint from "@eslint/js";
2 | import solid from "eslint-plugin-solid";
3 | import * as globals from "globals";
4 | import tseslint from "typescript-eslint";
5 | import tsParser from "@typescript-eslint/parser";
6 |
7 | export default tseslint.config(
8 | eslint.configs.recommended,
9 | tseslint.configs.recommended,
10 | {
11 | name: "global-ignores",
12 | ignores: [
13 | "**/dist/**",
14 | "**/node_modules/**",
15 | ".github/",
16 | ".solid/",
17 | ".vinxi/",
18 | ".netlify/",
19 | "public/",
20 | "scripts/",
21 | ],
22 | },
23 | {
24 | files: ["**/*.{ts,tsx}"],
25 | languageOptions: {
26 | parser: tsParser,
27 | parserOptions: {
28 | project: "tsconfig.json",
29 | ecmaVersion: "latest",
30 | sourceType: "module",
31 | },
32 | globals: {
33 | ...globals.browser,
34 | ...globals.node,
35 | },
36 | },
37 | plugins: {
38 | solid,
39 | },
40 | rules: {
41 | quotes: ["error", "double"],
42 | semi: "warn",
43 | "@typescript-eslint/no-unused-vars": [
44 | "error",
45 | {
46 | args: "all",
47 | argsIgnorePattern: "^_",
48 | caughtErrors: "all",
49 | caughtErrorsIgnorePattern: "^_",
50 | destructuredArrayIgnorePattern: "^_",
51 | varsIgnorePattern: "^_",
52 | ignoreRestSiblings: true,
53 | },
54 | ],
55 | },
56 | }
57 | );
58 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/dev.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: DEV
3 | use_cases: >-
4 | development debugging, build optimization, library development, conditional
5 | code, dev-only features
6 | tags:
7 | - development
8 | - debugging
9 | - builds
10 | - optimization
11 | - conditional
12 | version: '1.0'
13 | description: >-
14 | Access development-only features in SolidJS with the DEV export. Enable
15 | additional checks and debugging tools that are removed in production.
16 | ---
17 |
18 | ```ts
19 | import { DEV } from "solid-js"
20 |
21 | const DEV: object | undefined
22 | ```
23 |
24 | On the client, Solid provides (via [conditional exports](https://nodejs.org/api/packages.html#conditional-exports)) different builds depending on whether the **development** condition is set.
25 | Development mode provides some additional checking — e.g. detecting accidental use of multiple instances of Solid — which are removed in production builds.
26 |
27 | If you want code to run only in development mode (most useful in libraries), you can check whether the **DEV** export is defined.
28 | Note that it is always defined on the server, so you may want to combine with [isServer](/reference/rendering/is-server):
29 |
30 | ```ts
31 | import { DEV } from "solid-js"
32 | import { isServer } from "solid-js/web"
33 |
34 | if (DEV && !isServer) {
35 | console.log(...);
36 | }
37 | ```
38 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/get.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: GET
3 | use_cases: >-
4 | http caching, rest api, data fetching, cache headers, seo optimization, cdn
5 | caching
6 | tags:
7 | - http
8 | - get
9 | - cache
10 | - api
11 | - rest
12 | - fetch
13 | version: '1.0'
14 | description: >-
15 | Create cacheable GET server functions in SolidStart. Leverage HTTP cache
16 | headers for improved performance and SEO optimization.
17 | ---
18 |
19 | `GET` helps to create a server function which is accessed via an [HTTP GET request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET).
20 | When this function is called, arguments are serialized into the URL, thus allowing the use of [HTTP cache-control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) headers.
21 |
22 | For example, `GET` can be used to make a streaming promise with a 60 second cache life:
23 |
24 | ```tsx {4, 8}
25 | import { json } from "@solidjs/router";
26 | import { GET } from "@solidjs/start";
27 |
28 | const hello = GET(async (name: string) => {
29 | "use server";
30 | return json(
31 | { hello: new Promise((r) => setTimeout(() => r(name), 1000)) },
32 | { headers: { "cache-control": "max-age=60" } }
33 | );
34 | });
35 | ```
36 |
37 | ## Parameters
38 |
39 | `GET any>(fn: T): (...args: Parameters) => ReturnType`
40 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/render-to-string.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: renderToString
3 | use_cases: >-
4 | basic ssr, static site generation, synchronous rendering, progressive
5 | hydration, seo pages
6 | tags:
7 | - ssr
8 | - rendering
9 | - hydration
10 | - synchronous
11 | - static
12 | version: '1.0'
13 | description: >-
14 | Generate HTML strings synchronously with renderToString. Perfect for SSR with
15 | progressive hydration and static site generation needs.
16 | ---
17 |
18 | ```ts
19 | import { renderToString } from "solid-js/web"
20 |
21 | function renderToString(
22 | fn: () => T,
23 | options?: {
24 | nonce?: string
25 | renderId?: string
26 | }
27 | ): string
28 |
29 | ```
30 |
31 | Renders to a string synchronously.
32 | The function also generates a script tag for progressive hydration.
33 | Options include eventNames to listen to before the page loads and play back on hydration, and nonce to put on the script tag.
34 |
35 | `renderId` is used to namespace renders when having multiple top level roots.
36 |
37 | ```ts
38 | const html = renderToString(App)
39 | ```
40 |
41 | ## Options
42 |
43 | | Name | Type | Description |
44 | | ---------- | -------- | ------------------------------------ |
45 | | `nonce` | `string` | The nonce to use for the script tag. |
46 | | `renderId` | `string` | The id to use for the script tag. |
47 |
--------------------------------------------------------------------------------
/src/routes/reference/lifecycle/on-mount.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: onMount
3 | order: 5
4 | use_cases: >-
5 | initial setup, dom refs access, one-time initialization, component mounting,
6 | element manipulation after render
7 | tags:
8 | - lifecycle
9 | - mounting
10 | - refs
11 | - dom
12 | - initialization
13 | version: '1.0'
14 | description: >-
15 | Run code after SolidJS components mount to the DOM. Perfect for accessing
16 | refs, setting up third-party libraries, and one-time initializations.
17 | ---
18 |
19 | Registers a method that runs after initial rendering is done and the elements are mounted to the page.
20 | Ideal for using [refs](/reference/jsx-attributes/ref) and managing other one-time setup.
21 |
22 | ```tsx
23 | import { onMount } from "solid-js"
24 |
25 | function onMount(fn: () => void): void
26 |
27 | ```
28 |
29 | This is an alias for an effect that is non-tracking, meaning that it is equivalent to a [`createEffect`](/reference/basic-reactivity/create-effect) with no dependencies.
30 |
31 | ```tsx
32 | // example that shows how to use onMount to get a reference to an element
33 | import { onMount } from "solid-js"
34 |
35 | function MyComponent() {
36 | let ref: HTMLButtonElement
37 |
38 | // when the component is mounted, the button will be disabled
39 | onMount(() => {
40 | ref.disabled = true
41 | })
42 | return Focus me!
43 | }
44 | ```
45 |
--------------------------------------------------------------------------------
/src/routes/solid-router/concepts/catch-all.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Catch-all routes
3 | use_cases: >-
4 | 404 pages, handling invalid urls, fallback routes, error boundaries, redirect
5 | unknown paths
6 | tags:
7 | - '404'
8 | - error-pages
9 | - fallback
10 | - routing
11 | - wildcards
12 | version: '1.0'
13 | description: >-
14 | Create catch-all routes in SolidJS to handle 404 errors and redirect users
15 | from invalid URLs to proper fallback pages.
16 | ---
17 |
18 | Catch-all routes are used to match any URL that does not match any other route in the application.
19 | This is useful for displaying a 404 page or redirecting to a specific route when a user enters an invalid URL.
20 |
21 | To create a catch-all route, place a route with an asterisk (`*`) as the path at the end of the route list.
22 | Optionally, you can name the parameter to access the unmatched part of the URL.
23 |
24 | ```jsx
25 | import { Router, Route } from "@solidjs/router";
26 |
27 | import Home from "./Home";
28 | import About from "./About";
29 | import NotFound from "./NotFound";
30 |
31 | const App = () => (
32 |
33 |
34 |
35 |
36 |
37 | );
38 | ```
39 |
40 | Now, if a user navigates to a URL that does not match `/home` or `/about`, the `NotFound` component will be rendered.
41 |
--------------------------------------------------------------------------------
/src/routes/guides/deployment-options/stormkit.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Stormkit
3 | order: 7
4 | mainNavExclude: true
5 | use_cases: >-
6 | spa deployment, serverless functions, static hosting, git deployment,
7 | production hosting
8 | tags:
9 | - stormkit
10 | - deployment
11 | - hosting
12 | - serverless
13 | - spa
14 | - static
15 | version: '1.0'
16 | description: >-
17 | Deploy Solid apps as static sites or SPAs on Stormkit with serverless
18 | functions support and Git provider integration.
19 | ---
20 |
21 | [Stormkit](https://www.stormkit.io) is a deployment platform for static websites, single-page applications (SPAs), and serverless functions.
22 |
23 | 1. Log in to Stormkit.
24 |
25 | 2. Using the user interface, import your Solid project from one of the three supported Git providers (GitHub, GitLab, or Bitbucket).
26 |
27 | 3. Navigate to the project’s production environment in Stormkit or create a new environment if needed.
28 |
29 | 4. Verify the build command in your Stormkit configuration. By default, Stormkit CI will run `npm run build` but you can specify a custom build command on this page.
30 |
31 | 5. Check output folder, unless its specified Stormkit will try to upload contents of build folder.
32 |
33 | 6. Click the “Deploy Now” button to deploy your site. Stormkit CI will build your code and upload contents of it.
34 |
35 | Find more details on [Stormkit Documentation](https://stormkit.io/docs).
36 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/style.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Style
3 | order: 4
4 | use_cases: 'inline styles, critical css, theme styles, dynamic styling, css-in-js'
5 | tags:
6 | - style
7 | - css
8 | - inline
9 | - styling
10 | - head
11 | version: '1.0'
12 | description: >-
13 | Add inline CSS styles to your Solid app's head with the Style component.
14 | Useful for critical CSS and dynamic styling needs in your application.
15 | ---
16 |
17 | `Style` is a component that adds the [`style`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) element to your document's `head`.
18 |
19 | ```tsx twoslash
20 | import { Style } from "@solidjs/meta";
21 |
22 | ;
29 | ```
30 |
31 | ## Usage
32 |
33 | ### Adding `style` tag
34 |
35 | The `Style` component can add CSS to style elements within your application.
36 | It is recommended to add styles in an external stylesheet and use a `Link` instead, rather than using this component, however.
37 |
38 | :::tip[Note]
39 | Styles within the `Style` component are not scoped.
40 | :::
41 |
42 | ```tsx twoslash
43 | import { MetaProvider, Style } from "@solidjs/meta";
44 |
45 | export default function Root() {
46 | return (
47 |
48 |
53 |
54 | );
55 | }
56 | ```
57 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-resolved-path.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useResolvedPath
3 | use_cases: >-
4 | modular routing, nested routers, relative paths, dynamic base paths, component
5 | isolation
6 | tags:
7 | - path
8 | - modular
9 | - nested
10 | - routing
11 | - base
12 | - resolved
13 | version: '1.0'
14 | description: >-
15 | Resolve relative paths with useResolvedPath - build modular routers, handle
16 | nested routes, and create isolated routing components.
17 | ---
18 |
19 | `useResolvedPath` retrieves a signal\.
20 | It contains the current resolved path as defined in the Route.
21 |
22 | ```js
23 | const path = useResolvedPath(() => '');
24 |
25 | // Parent Route path: /user/*
26 | console.log(path()); // /user
27 |
28 | const path = useResolvedPath(() => 'a/b/c');
29 |
30 | // Parent Route path: /user/*
31 | console.log(path()); // /user/a/b/c
32 |
33 | const path = useResolvedPath(() => '/a/b/c'); // Note: /
34 |
35 | // Parent Route path: /user/*
36 | console.log(path()); // a/b/c
37 | ```
38 |
39 | Useful for making modular routers
40 |
41 | ```js
42 | const parentRoutePath = useResolvedPath(() => '');
43 |
44 | return <>
45 | Module component layer
46 | // Modular magic
47 | Index
}/>
48 | AComponent
}/>
49 |
50 | >
51 | ```
52 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/ref.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: ref
3 | order: 7
4 | use_cases: >-
5 | dom access, element manipulation, focus management, measurements, third-party
6 | libraries, animations
7 | tags:
8 | - refs
9 | - dom
10 | - elements
11 | - access
12 | - manipulation
13 | - components
14 | version: '1.0'
15 | description: >-
16 | Access DOM elements directly in SolidJS with refs. Get references to rendered
17 | elements for imperative operations and third-party integrations.
18 | ---
19 |
20 | Refs are a way of getting access to underlying DOM elements in our JSX. While it is true one could just assign an element to a variable, it is more optimal to leave components in the flow of JSX. Refs are assigned at render time but before the elements are connected to the DOM. They come in 2 flavors.
21 |
22 | ```tsx
23 | // variable assigned directly by ref
24 | let myDiv;
25 |
26 | // use onMount or createEffect to read after connected to the DOM
27 | onMount(() => console.log(myDiv));
28 |
29 |
30 |
31 | // Or, callback function (called before connected to the DOM)
32 | console.log(el)} />
33 | ```
34 |
35 | Refs can also be used on Components. They still need to be attached on the other side.
36 |
37 | ```tsx
38 | function MyComp(props) {
39 | return
40 | }
41 |
42 | function App() {
43 | let myDiv
44 | onMount(() => console.log(myDiv.clientWidth))
45 | return
46 | }
47 | ```
48 |
--------------------------------------------------------------------------------
/src/styles/fonts.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "Geist";
3 | src: url("/fonts/Geist-Light.woff2") format("woff2");
4 | font-weight: 400;
5 | font-style: normal;
6 | font-display: swap;
7 | }
8 |
9 | @font-face {
10 | font-family: "Geist";
11 | src: url("/fonts/Geist-SemiBold.woff2") format("woff2");
12 | font-weight: 600;
13 | font-style: normal;
14 | font-display: swap;
15 | }
16 |
17 | @font-face {
18 | font-family: "Geist";
19 | src: url("/fonts/Geist-Bold.woff2") format("woff2");
20 | font-weight: 700;
21 | font-style: normal;
22 | font-display: swap;
23 | }
24 |
25 | @font-face {
26 | font-family: "GeistMono";
27 | src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
28 | font-weight: normal;
29 | font-style: normal;
30 | font-display: swap;
31 | }
32 |
33 | @font-face {
34 | font-family: "GeistMono";
35 | src: url("/fonts/GeistMono-Medium.woff2") format("woff2");
36 | font-weight: 500;
37 | font-style: normal;
38 | font-display: swap;
39 | }
40 |
41 | @font-face {
42 | font-family: "GeistMono";
43 | src: url("/fonts/GeistMono-SemiBold.woff2") format("woff2");
44 | font-weight: 600;
45 | font-style: normal;
46 | font-display: swap;
47 | }
48 |
49 | @font-face {
50 | font-family: "GeistMono";
51 | src: url("/fonts/GeistMono-Bold.woff2") format("woff2");
52 | font-weight: 700;
53 | font-style: normal;
54 | font-display: swap;
55 | }
56 |
57 | :root {
58 | --font-geist: "Geist", sans-serif;
59 | --font-geist-mono: "GeistMono", monospace;
60 | }
61 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/client/mount.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: mount
3 | use_cases: >-
4 | app initialization, entry point setup, bootstrapping, client rendering,
5 | hydration control
6 | tags:
7 | - mount
8 | - hydration
9 | - rendering
10 | - initialization
11 | - entry-client
12 | version: '1.0'
13 | description: >-
14 | Bootstrap your SolidStart application with mount. Automatically handles
15 | hydration for SSR or client-only rendering modes.
16 | ---
17 |
18 | `mount` is a method that calls either [`hydrate`](/reference/rendering/hydrate) (server rendering) or [`render`](/reference/rendering/render) (client rendering) depending on the configuration.
19 | It is used in [`entry-client.tsx`](/solid-start/reference/entrypoints/entry-client) to bootstrap an application.
20 |
21 | ```tsx
22 | import { mount, StartClient } from "@solidjs/start/client";
23 |
24 | mount(() =>
, document.getElementById("app")!);
25 | ```
26 |
27 | If you set `{ ssr: false }` in the [`defineConfig`](/solid-start/reference/config/define-config), effectively deactivating hydration, then `mount` becomes the same as [`render`](/reference/rendering/render).
28 |
29 | ## Parameters
30 |
31 | | Prop | type | description |
32 | | ---- | ----------------- | ------------------------------------------- |
33 | | fn | () => JSX.Element | Function that returns the application code. |
34 | | el | MountableElement | DOM Element to mount the application to |
35 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/hydration-script.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: hydrationScript
3 | use_cases: >-
4 | ssr hydration, server-side rendering, initial page load optimization,
5 | capturing events before js loads
6 | tags:
7 | - ssr
8 | - hydration
9 | - performance
10 | - events
11 | - bootstrap
12 | version: '1.0'
13 | description: >-
14 | Bootstrap client-side hydration in SSR apps with HydrationScript. Capture and
15 | replay events before JavaScript loads for seamless user experience.
16 | ---
17 |
18 | ```ts
19 | import { generateHydrationScript, HydrationScript } from "solid-js/web"
20 | import type { JSX } from "solid-js"
21 |
22 | function generateHydrationScript(options: {
23 | nonce?: string
24 | eventNames?: string[]
25 | }): string
26 |
27 | function HydrationScript(props: {
28 | nonce?: string
29 | eventNames?: string[]
30 | }): JSX.Element
31 |
32 | ```
33 |
34 | Hydration Script is a special script that should be placed once on the page to bootstrap hydration before Solid's runtime has loaded.
35 | It comes both as a function that can be called and inserted in an HTML string, or as a Component if you are rendering JSX from the `` tag.
36 |
37 | The options are for the **nonce** to be put on the script tag and any event names for that Solid should capture before scripts have loaded and replay during hydration.
38 | These events are limited to those that Solid delegates which include most UI Events that are composed and bubble.
39 | By default it is only click and input events.
40 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-navigate.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useNavigate
3 | use_cases: >-
4 | programmatic navigation, redirects, auth flows, form submissions, history
5 | manipulation
6 | tags:
7 | - navigate
8 | - redirect
9 | - programmatic
10 | - history
11 | - state
12 | version: '1.0'
13 | description: >-
14 | Navigate programmatically with useNavigate - redirect users, handle auth
15 | flows, and control navigation with replace and scroll options.
16 | ---
17 |
18 | Retrieves the method which accepts a path to navigate to and an optional object with the following options:
19 |
20 | - resolve (_boolean_, default `true`): resolve the path against the current route
21 | - replace (_boolean_, default `false`): replace the history entry
22 | - scroll (_boolean_, default `true`): scroll to top after navigation
23 | - state (_any_, default `undefined`): pass custom state to `location.state`
24 |
25 | ```js
26 | const navigate = useNavigate();
27 |
28 | if (unauthorized) {
29 | navigate("/login", { replace: true });
30 | }
31 | ```
32 |
33 | If you are inside of a query, action or cache (deprecated) function you will instead want to use [redirect](/solid-router/reference/response-helpers/redirect) or [reload](/solid-router/reference/response-helpers/reload).
34 |
35 | :::note
36 | The state is serialized using the [structured clone
37 | algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
38 | which does not support all object types.
39 | :::
40 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/index-array.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: indexArray
3 | use_cases: >-
4 | rendering lists by index, stable item references, index-based list operations,
5 | optimized list rendering
6 | tags:
7 | - arrays
8 | - lists
9 | - index
10 | - rendering
11 | - optimization
12 | version: '1.0'
13 | description: >-
14 | Map arrays by index in SolidJS where items are signals and indices are
15 | constant. Optimized helper for index-based list rendering patterns.
16 | ---
17 |
18 | ```tsx
19 | import { indexArray } from "solid-js"
20 |
21 | function indexArray
(
22 | list: () => readonly T[],
23 | mapFn: (v: () => T, i: number) => U
24 | ): () => U[]
25 |
26 | ```
27 |
28 | Similar to `mapArray` except it maps by index.
29 | The item is a signal and the index is now the constant.
30 |
31 | Underlying helper for the `` control flow.
32 |
33 | ```tsx
34 | const mapped = indexArray(source, (model) => {
35 | return {
36 | get id() {
37 | return model().id
38 | }
39 | get firstInitial() {
40 | return model().firstName[0];
41 | },
42 | get fullName() {
43 | return `${model().firstName} ${model().lastName}`;
44 | },
45 | }
46 | });
47 | ```
48 |
49 | ## Arguments
50 |
51 | | Name | Type | Description |
52 | | :---- | :----------------------------- | :-------------------- |
53 | | list | `() => readonly T[]` | The list to map. |
54 | | mapFn | `(v: () => T, i: number) => U` | The mapping function. |
55 |
--------------------------------------------------------------------------------
/src/routes/solid-router/advanced-concepts/lazy-loading.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Lazy loading
3 | use_cases: >-
4 | optimizing bundle size, code splitting, reducing initial load, large apps,
5 | performance optimization
6 | tags:
7 | - lazy
8 | - performance
9 | - routing
10 | - optimization
11 | - splitting
12 | - loading
13 | version: '1.0'
14 | description: >-
15 | Implement lazy loading in Solid Router to reduce initial bundle size. Load
16 | components on-demand for better performance in large applications.
17 | ---
18 |
19 | Lazy loading allows you to load only the necessary resources when they are needed.
20 | This can be useful when you have a large application with a lot of routes and components, and you want to reduce the initial load time.
21 |
22 | In Solid Router, you can lazy load components using the `lazy` function from Solid:
23 |
24 | ```jsx
25 | import { lazy } from "solid-js";
26 | import { Router, Route } from "@solidjs/router";
27 |
28 | const Home = lazy(() => import("./Home"));
29 |
30 | const Users = lazy(() => import("./Users"));
31 |
32 | const App = () => (
33 |
34 |
35 |
36 |
37 | );
38 | ```
39 |
40 | In the example above, the `Users` component is lazy loaded using the `lazy` function.
41 | The `lazy` function takes a function that returns a promise, which resolves to the component you want to load.
42 | When the route is matched, the component will be loaded and rendered.
43 |
--------------------------------------------------------------------------------
/src/routes/guides/deployment-options/aws-via-sst.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: AWS via SST
3 | order: 1
4 | mainNavExclude: true
5 | use_cases: >-
6 | serverless deployment, aws lambda, container deployment, cloud infrastructure,
7 | production deployment
8 | tags:
9 | - aws
10 | - sst
11 | - serverless
12 | - lambda
13 | - deployment
14 | - containers
15 | version: '1.0'
16 | description: >-
17 | Deploy SolidStart apps to AWS Lambda or containers using SST framework with
18 | streamlined configuration and deployment.
19 | ---
20 |
21 | [SST](https://sst.dev/) is a framework for deploying applications to any cloud provider. It has a built-in way to deploy SolidStart apps to AWS Lambda. For additional details, you can [visit their docs](https://sst.dev/docs/).
22 |
23 | ## Quick start
24 |
25 | 1. [Create a SolidStart app](/solid-start/getting-started).
26 |
27 | 2. In your project, init SST.
28 |
29 | ```package-exec
30 | sst@latest init
31 | ```
32 |
33 | 3. This will detect your SolidStart app and ask you to update your `app.config.ts`.
34 |
35 | ```ts title="app.config.ts"
36 | server: {
37 | preset: "aws-lambda-streaming"
38 | }
39 | ```
40 |
41 | 4. When you are ready, you can deploy your app using:
42 |
43 | ```package-exec
44 | sst@latest deploy --stage production
45 | ```
46 |
47 | You can [read the full tutorial on the SST docs](https://sst.dev/docs/start/aws/solid).
48 |
49 | ## Deploy to a Container
50 |
51 | You can also deploy your SolidStart app to a [container](https://sst.dev/docs/start/aws/solid#containers) using SST.
52 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-location.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useLocation
3 | use_cases: >-
4 | current url tracking, query parameters, pathname parsing, hash navigation,
5 | location state access
6 | tags:
7 | - location
8 | - url
9 | - pathname
10 | - query
11 | - hash
12 | - state
13 | version: '1.0'
14 | description: >-
15 | Access reactive URL information with useLocation - track pathname, query
16 | strings, hash, and navigation state in your SolidJS app.
17 | ---
18 |
19 | Retrieves reactive `location` object useful for getting things like `pathname`
20 |
21 | ```js
22 | const location = useLocation();
23 |
24 | const pathname = createMemo(() => parsePath(location.pathname));
25 | ```
26 |
27 | | attribute | type | description |
28 | | ---------- | ------ | ----------------------------------------------------------------------------------------- |
29 | | `pathname` | string | The pathname part of the URL, without the query string. |
30 | | `search` | string | The query string part of the URL. |
31 | | `hash` | string | The hash part of the URL, including the `#`. |
32 | | `state` | any | Custom state passed from [`useNavigate`](/solid-router/reference/primitives/use-navigate) |
33 | | `query` | object | Returns a store-like object containing all the query parameters of the URL. |
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/REQUEST.yml:
--------------------------------------------------------------------------------
1 | name: "Request 💡"
2 | title: "[Request]:"
3 | description: Share an idea.
4 | labels: [
5 | "request", "pending review"
6 | ]
7 | assignees:
8 | - ladybluenotes
9 | body:
10 | - type: markdown
11 | attributes:
12 | value: "## Reminder: If reporting a minor correction (e.g. typo), feel free to submit a PR directly!"
13 | - type: dropdown
14 | id: request-topic
15 | attributes:
16 | label: "What is this request related to?"
17 | options:
18 | - Request
19 | - Styling
20 | - Feature
21 | validations:
22 | required: true
23 | - type: textarea
24 | id: page
25 | attributes:
26 | label: "📋 Suggested"
27 | description: Please provide the URL of the page(s) or section this idea is related to.
28 | placeholder: https://docs.solidjs.com/concepts/intro-to-reactivity
29 | validations:
30 | required: false
31 | - type: textarea
32 | id: generalDesc
33 | attributes:
34 | label: "📋 General description or bullet points"
35 | description: Please provide a general description or bullet points about what you would like to see added.
36 | placeholder: "..."
37 | validations:
38 | required: true
39 | - type: textarea
40 | id: example
41 | attributes:
42 | label: "🖥️ Reproduction of code samples in StackBlitz"
43 | description: If you would like to suggest code samples please attach a working reproduction.
44 | placeholder: "..."
45 | validations:
46 | required: false
47 |
--------------------------------------------------------------------------------
/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/routes/reference/secondary-primitives/create-deferred.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: createDeferred
3 | use_cases: >-
4 | performance optimization, idle updates, non-critical ui updates, debouncing
5 | changes, reducing re-renders
6 | tags:
7 | - performance
8 | - optimization
9 | - deferred
10 | - idle
11 | - updates
12 | version: '1.0'
13 | description: >-
14 | Defer reactive updates until browser idle with createDeferred. Optimize
15 | performance by batching non-critical changes with timeout control.
16 | ---
17 |
18 | ```ts
19 | import { createDeferred } from "solid-js"
20 |
21 | function createDeferred(
22 | source: () => T,
23 | options?: {
24 | timeoutMs?: number
25 | equals?: false | ((prev: T, next: T) => boolean)
26 | name?: string
27 | }
28 | ): () => T
29 |
30 | ```
31 |
32 | Creates a readonly that only notifies downstream changes when the browser is idle.
33 | `timeoutMs` is the maximum time to wait before forcing the update.
34 |
35 | ## Options
36 |
37 | | Name | Type | Description |
38 | | --------- | ------------------------------------------ | ------------------------------------------------------ |
39 | | timeoutMs | `number` | The maximum time to wait before forcing the update. |
40 | | equals | `false or ((prev: T, next: T) => boolean)` | A function that returns true if the value has changed. |
41 | | name | `string` | The name of the readonly. |
42 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/CONTENT.yml:
--------------------------------------------------------------------------------
1 | name: "Content Report 📄"
2 | title: "[Content]:"
3 | description: Report an issue with existing content.
4 | labels: [
5 | "improve documentation", "pending review"
6 | ]
7 | assignees:
8 | - ladybluenotes
9 | body:
10 | - type: markdown
11 | attributes:
12 | value: "# Reminder: If reporting a minor correction (e.g. typo), feel free to submit a PR directly!"
13 | - type: input
14 | id: subject
15 | attributes:
16 | label: 📚 Subject area/topic
17 | description: Documentation area/topic (e.g. Components, Signals, Reference)
18 | placeholder: "..."
19 | validations:
20 | required: true
21 | - type: textarea
22 | id: page
23 | attributes:
24 | label: "📋 Page(s) affected (or suggested, for new content)"
25 | description: Please provide the URL of the page(s) affected.
26 | placeholder: https://docs.solidjs.com/concepts/intro-to-reactivity
27 | validations:
28 | required: true
29 | - type: textarea
30 | id: generalDesc
31 | attributes:
32 | label: "📋 Description of content that is out-of-date or incorrect"
33 | description: Let us know what's wrong!
34 | placeholder: "..."
35 | validations:
36 | required: true
37 | - type: textarea
38 | id: incorrectContent
39 | attributes:
40 | label: "🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)"
41 | description: If you are reporting incorrect content or code samples, you can also attach a reproduction in stackblitz.
42 | validations:
43 | required: false
44 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/entrypoints/entry-server.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: entry-server.tsx
3 | use_cases: >-
4 | server initialization, ssr setup, html document structure, meta tags, server
5 | bootstrap
6 | tags:
7 | - entry
8 | - server
9 | - ssr
10 | - initialization
11 | - document
12 | - html
13 | version: '1.0'
14 | description: >-
15 | Define server entry point and HTML document structure for SolidStart.
16 | Configure SSR modes and set up server-side rendering bootstrap.
17 | ---
18 |
19 | `entry-server.tsx` is where an application starts on the server.
20 | This happens by `entry-server.tsx` providing a document component to [``](/solid-start/reference/server/start-server) and passing it into [`createHandler`](/solid-start/reference/server/create-handler) for server side rendering.
21 | A typical `entry-server.tsx` for a new project looks like this:
22 |
23 | ```tsx
24 | import { createHandler, StartServer } from "@solidjs/start/server";
25 |
26 | export default createHandler(() => (
27 | (
29 |
30 |
31 |
32 |
33 |
34 | {assets}
35 |
36 |
37 | {children}
38 | {scripts}
39 |
40 |
41 | )}
42 | />
43 | ));
44 | ```
45 |
46 | For setting different SSR modes (sync | async | stream), see [`createHandler`](/solid-start/reference/server/create-handler).
47 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/routing/file-routes.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: FileRoutes
3 | use_cases: >-
4 | file-based routing, automatic route generation, spa routing, route
5 | configuration
6 | tags:
7 | - routing
8 | - files
9 | - routes
10 | - navigation
11 | - filesystem
12 | - spa
13 | version: '1.0'
14 | description: >-
15 | Automatically generate routes from file structure in SolidStart. Create route
16 | configurations from files in the /src/routes directory.
17 | ---
18 |
19 | `FileRoutes` is a component that creates a [`Route`](/solid-router/reference/components/route) for each file in the `/src/routes` directory.
20 | This creates a `route` export to define the route configuration for the router of your choice.
21 |
22 | For example, using [`solid-router`](/solid-router) would look like the following:
23 |
24 | ```tsx {7-9} title="app.tsx"
25 | import { Suspense } from "solid-js";
26 | import { Router } from "@solidjs/router";
27 | import { FileRoutes } from "@solidjs/start/router";
28 |
29 | export default function App() {
30 | return (
31 | {props.children} }>
32 |
33 |
34 | );
35 | }
36 | ```
37 |
38 | See the [SolidStart routing guide](/solid-start/building-your-application/routing) for more details.
39 |
40 | :::caution
41 | If removing the `FileRoutes` component from your `app.tsx` file, you will need to manually add all of your routes.
42 |
43 | While this is possible it does come with tradeoffs.
44 | For example, optimizations such as preloaded script tags will no longer be available.
45 |
46 | :::
47 |
--------------------------------------------------------------------------------
/src/routes/reference/components/no-hydration.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | use_cases: >-
4 | static content, ssr optimization, performance, reducing bundle size,
5 | server-only rendering
6 | tags:
7 | - ssr
8 | - hydration
9 | - optimization
10 | - performance
11 | - static
12 | - server-rendering
13 | version: '1.0'
14 | description: >-
15 | Prevent client-side hydration for static content in SolidJS. Optimize
16 | performance by skipping hydration for server-rendered static elements.
17 | ---
18 |
19 | The `` component prevents the client-side hydration process from being applied to its children.
20 | During server-side rendering, components and elements wrapped within `` will render normally on the server, contributing to the initial HTML output.
21 | However, during client-side hydration, Solid bypasses the hydration process for the content within ``.
22 | This means that elements within `` will not have event listeners attached by Solid, and their state will not be managed reactively on the client-side after the initial render.
23 |
24 | :::note
25 | Placing a `` component inside `` has no effect and will not override the `` behavior.
26 | :::
27 |
28 | ## Example
29 |
30 | ```tsx
31 | import { NoHydration } from "solid-js/web";
32 | import { InteractiveComponent, StaticContent } from "./components";
33 |
34 | function Example() {
35 | return (
36 |
37 |
38 |
39 |
40 |
41 |
42 | );
43 | }
44 | ```
45 |
--------------------------------------------------------------------------------
/src/routes/solid-meta/reference/meta/meta.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Meta
3 | order: 3
4 | use_cases: >-
5 | seo optimization, social media tags, viewport settings, charset configuration,
6 | open graph
7 | tags:
8 | - meta
9 | - seo
10 | - viewport
11 | - metadata
12 | - head
13 | - tags
14 | version: '1.0'
15 | description: >-
16 | Add SEO and viewport metadata to your Solid app with the Meta component.
17 | Configure description, keywords, and social media tags for better reach.
18 | ---
19 |
20 | The ` ` component represents metadata that cannot be represented by other HTML elements.
21 | It is a wrapper for the native [`meta`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) element and has the same properties.
22 |
23 | ```tsx twoslash
24 | import { Meta } from "@solidjs/meta";
25 |
26 | ;
27 | ```
28 |
29 |
30 | `Meta` components can be placed in the [`MetaProvider`](/solid-meta/reference/meta/metaprovider) or added throughout the application for additional metadata or override parents.
31 | `Meta` tags are considered the same and will be overridden if `name` attributes match.
32 | ## Usage
33 |
34 | ### Adding `meta` tag
35 |
36 | ```tsx twoslash {6-8}
37 | import { MetaProvider, Meta } from "@solidjs/meta";
38 |
39 | export default function Root() {
40 | return (
41 |
42 |
43 |
44 |
45 |
46 | );
47 | }
48 | ```
49 |
--------------------------------------------------------------------------------
/src/routes/solid-start/advanced/request-events.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Request events
3 | use_cases: >-
4 | server context access, local data storage, request handling, server functions,
5 | event access
6 | tags:
7 | - events
8 | - server
9 | - context
10 | - locals
11 | - requests
12 | - functions
13 | version: '1.0'
14 | description: >-
15 | Access request events and local context in SolidStart server functions.
16 | Type-safe locals and native event handling for server code.
17 | ---
18 |
19 | Request events in SolidStart are retrieved using the [`getRequestEvent`](/reference/server-utilities/get-request-event) from `@solidjs/web`.
20 | These requests happen anywhere on the server.
21 |
22 | ## Locals
23 |
24 | SolidStart uses `event.locals` to pass around a local context where needed.
25 |
26 | When adding fields to `event.locals`, the fields can be typed:
27 |
28 | ```tsx title="global.d.ts"
29 | ///
30 | declare module App {
31 | interface RequestEventLocals {
32 | /**
33 | * Declare your getRequestEvent().locals here
34 | */
35 | }
36 | }
37 | ```
38 |
39 | ## nativeEvent
40 |
41 | Sometimes access is still needed to the underlying event from [Vinxi](https://vinxi.vercel.app/).
42 | This can be accessed that using the `.nativeEvent` property, which is the underlying H3Event used, and can be passed to the helpers available in the ecosystem.
43 | Note that Vinxi HTTP helpers _do not_ treeshake so you can only import them in files that do not contain client or isomorphic code.
44 |
45 | Many of these events support Async Local Storage so this may not be needed.
46 |
--------------------------------------------------------------------------------
/src/ui/tabs.tsx:
--------------------------------------------------------------------------------
1 | import { type PolymorphicProps } from "@kobalte/core";
2 | import {
3 | Tabs as KobalteTabs,
4 | type TabsRootProps as KobalteTabsRootProps,
5 | type TabsListProps as KobalteTabsListProps,
6 | type TabsTriggerProps as KobalteTabsTriggerProps,
7 | type TabsContentProps as KobalteTabsContentProps,
8 | } from "@kobalte/core/tabs";
9 |
10 | export type TabsProps = PolymorphicProps<
11 | "div",
12 | Omit
13 | >;
14 |
15 | export function Tabs(props: TabsProps) {
16 | return ;
17 | }
18 |
19 | export type TabListProps = PolymorphicProps<
20 | "div",
21 | Omit
22 | >;
23 |
24 | export function TabList(props: TabListProps) {
25 | return (
26 |
27 |
28 |
29 | );
30 | }
31 |
32 | export type TabProps = PolymorphicProps<
33 | "button",
34 | Omit
35 | >;
36 |
37 | export function Tab(props: TabProps) {
38 | return (
39 |
43 | );
44 | }
45 |
46 | export type TabPanelProps = PolymorphicProps<
47 | "div",
48 | Omit
49 | >;
50 |
51 | export function TabPanel(props: TabPanelProps) {
52 | return (
53 |
54 | );
55 | }
56 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-preload-route.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: usePreloadRoute
3 | use_cases: >-
4 | performance optimization, manual preloading, predictive navigation,
5 | prefetching routes
6 | tags:
7 | - preload
8 | - performance
9 | - optimization
10 | - prefetch
11 | - manual
12 | version: '1.0'
13 | description: >-
14 | Manually preload routes with usePreloadRoute - optimize performance by
15 | prefetching route data before navigation in your SolidJS app.
16 | ---
17 |
18 | `usePreloadRoute` returns a function that can be used to preload a route manually.
19 |
20 | ```ts
21 | const preload = usePreloadRoute();
22 |
23 | preload(`/users/settings`, { preloadData: true });
24 | ```
25 |
26 | ## Usage
27 |
28 | Routes are preloaded by default within Solid Router contexts.
29 | This helper is useful when you want to preload a route in response to some other event, such as a button click or a timer.
30 |
31 | ## Type Signature
32 |
33 | ### Parameters
34 |
35 | | Parameter | Type | Required | Description |
36 | | --------- | -------- | -------- | ------------------------------------ |
37 | | `to` | `To` | Yes | The route path to preload |
38 | | `options` | `object` | No | Configuration options for preloading |
39 |
40 | ### Options
41 |
42 | | Option | Type | Default | Description |
43 | | ------------- | --------- | ------- | ------------------------------------------------------------------- |
44 | | `preloadData` | `boolean` | `false` | Whether to preload the route's data in addition to the route itself |
45 |
--------------------------------------------------------------------------------
/src/routes/solid-start/advanced/auth.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Auth
3 | use_cases: >-
4 | user authentication, protected routes, authorization checks, secure data
5 | access, login systems
6 | tags:
7 | - authentication
8 | - authorization
9 | - security
10 | - protected
11 | - login
12 | - users
13 | version: '1.0'
14 | description: >-
15 | Implement authentication and protected routes in SolidStart. Secure sensitive
16 | resources and handle user authorization properly.
17 | ---
18 |
19 | Server functions can be used to protect sensitive resources like user data.
20 |
21 | ```tsx
22 | "use server"
23 |
24 | async function getPrivatePosts() {
25 | const user = await getUser()
26 | if(!user) {
27 | return null // or throw an error
28 | }
29 |
30 | return db.getPosts({ userId: user.id, private: true })
31 | }
32 | ```
33 |
34 | The `getUser` function can be [implemented using sessions](/solid-start/advanced/session).
35 |
36 | ## Protected Routes
37 |
38 | Routes can be protected by checking the user or session object during data fetching.
39 | This example uses [Solid Router](/solid-router).
40 |
41 | ```tsx
42 | const getPrivatePosts = query(async function() {
43 | "use server"
44 | const user = await getUser()
45 | if(!user) {
46 | throw redirect("/login");
47 | }
48 |
49 | return db.getPosts({ userId: user.id, private: true })
50 | })
51 |
52 | export default function Page() {
53 | const posts = createAsync(() => getPrivatePosts());
54 | }
55 | ```
56 |
57 | Once the user hits this route, the router will attempt to fetch `getPrivatePosts` data.
58 | If the user is not signed in, `getPrivatePosts` will throw and the router will redirect to the login page.
59 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-before-leave.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useBeforeLeave
3 | use_cases: >-
4 | unsaved forms, exit confirmations, data loss prevention, user prompts before
5 | navigation, dirty state handling
6 | tags:
7 | - navigation
8 | - forms
9 | - confirmation
10 | - prevent
11 | - prompt
12 | - leave
13 | version: '1.0'
14 | description: >-
15 | Prevent route navigation with useBeforeLeave - prompt users before leaving
16 | with unsaved changes, handle exit confirmations in SolidJS.
17 | ---
18 |
19 | `useBeforeLeave` takes a function that will be called prior to leaving a route.
20 | The function will be called with:
21 |
22 | - from (_Location_): current location (before change).
23 | - to (_string | number_}: path passed to `navigate.`
24 | - options (_NavigateOptions_}: options passed to `navigate.`
25 | - preventDefault (_void function_): call to block the route change.
26 | - defaultPrevented (_readonly boolean_): `true` if any previously called leave handlers called `preventDefault()`.
27 | - retry (_void function_, _force?: boolean_ ): call to retry the same navigation.
28 | Pass `true` to skip running the leave handlers again (ie. force navigate without confirming).
29 |
30 | Example usage:
31 |
32 | ```js
33 | useBeforeLeave((e: BeforeLeaveEventArgs) => {
34 | if (form.isDirty && !e.defaultPrevented) {
35 | // preventDefault to block immediately and prompt user async
36 | e.preventDefault();
37 | setTimeout(() => {
38 | if (window.confirm("Discard unsaved changes - are you sure?")) {
39 | // user wants to proceed anyway so retry with force=true
40 | e.retry(true);
41 | }
42 | }, 100);
43 | }
44 | });
45 | ```
46 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/style.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: style
3 | order: 7
4 | use_cases: >-
5 | inline styling, dynamic styles, css variables, responsive design, theme
6 | customization, animated styles
7 | tags:
8 | - styling
9 | - css
10 | - inline
11 | - variables
12 | - dynamic
13 | - properties
14 | version: '1.0'
15 | description: >-
16 | Apply dynamic inline styles in SolidJS with string or object syntax. Set CSS
17 | properties and variables reactively for responsive component styling.
18 | ---
19 |
20 | Solid's style attribute lets you provide either a CSS string or an object where keys are CSS property names:
21 |
22 | ```tsx
23 | // string
24 |
25 |
26 | // object
27 |
31 | ```
32 |
33 | Unlike [React's style attribute](https://reactjs.org/docs/dom-elements.html#style), Solid uses **element.style.setProperty** under the hood. This means you need to use the lower-case, dash-separated version of property names instead of the JavaScript camel-cased version, such as `background-color` rather than `backgroundColor`. This actually leads to better performance and consistency with SSR output.
34 |
35 | ```tsx
36 | // string
37 |
38 |
39 | // object
40 |
45 | ```
46 |
47 | This also means you can set CSS variables! For example:
48 |
49 | ```tsx
50 | // set css variable
51 |
52 | ```
53 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/hydrate.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: hydrate
3 | use_cases: >-
4 | ssr hydration, client initialization, server-rendered apps, spa startup, dom
5 | rehydration
6 | tags:
7 | - hydration
8 | - ssr
9 | - rendering
10 | - initialization
11 | - dom
12 | version: '1.0'
13 | description: >-
14 | Hydrate server-rendered HTML with SolidJS client-side code. Essential for
15 | initializing SSR applications and attaching interactivity to static HTML.
16 | ---
17 |
18 | ```ts
19 | import { hydrate } from "solid-js/web"
20 | import type { JSX } from "solid-js"
21 | import type { MountableElement } from "solid-js/web"
22 |
23 | function hydrate(
24 | fn: () => JSX.Element,
25 | node: MountableElement,
26 | options?: { renderId?: string; owner?: unknown }
27 | ): () => void
28 |
29 | ```
30 |
31 | This method is similar to `render` except that it attempts to rehydrate what is already rendered to the DOM.
32 | When initializing in the browser a page has already been server rendered.
33 |
34 | ```ts
35 | const dispose = hydrate(App, document.getElementById("app"))
36 | ```
37 |
38 | ## Parameters
39 |
40 | | Prop | type | description |
41 | | -------------------- | ------------------ | ----------------------------------------------- |
42 | | fn | `() => JSX.Element`| Function that returns the application code. |
43 | | node | MountableElement | DOM Element to mount the application to |
44 | | options.renderId | string | |
45 | | options.owner | unknown | |
46 |
--------------------------------------------------------------------------------
/public/assets/firebase.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/ui/layout/mobile-navigation.tsx:
--------------------------------------------------------------------------------
1 | import { Dialog } from "@kobalte/core";
2 | import { Icon } from "solid-heroicons";
3 | import { bars_3, xMark } from "solid-heroicons/solid";
4 | import { MainNavigation } from "./main-navigation";
5 | import { createSignal } from "solid-js";
6 |
7 | interface Entry {
8 | title: string;
9 | path: string;
10 | children?: Entry[];
11 | mainNavExclude: boolean;
12 | isTranslated?: boolean;
13 | }
14 |
15 | interface NavProps {
16 | tree: {
17 | learn: Entry[];
18 | reference: Entry[];
19 | };
20 | }
21 |
22 | export const [isOpen, setIsOpen] = createSignal(false);
23 |
24 | export const MobileNavigation = (props: NavProps) => {
25 | return (
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | );
45 | };
46 |
--------------------------------------------------------------------------------
/src/routes/reference/components/dynamic.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | order: 5
4 | use_cases: >-
5 | dynamic components, conditional rendering, polymorphic components, runtime
6 | component selection, flexible ui, component switching
7 | tags:
8 | - dynamic
9 | - components
10 | - jsx
11 | - polymorphic
12 | - rendering
13 | - conditional
14 | version: '1.0'
15 | description: >-
16 | Render components dynamically at runtime with the Dynamic component. Perfect
17 | for polymorphic components and conditional component rendering.
18 | ---
19 |
20 | This component lets you insert an arbitrary Component or tag and passes the props through to it.
21 |
22 | ```tsx
23 | import { Dynamic } from "solid-js/web"
24 | import type { JSX } from "solid-js"
25 |
26 | function Dynamic(
27 | props: T & {
28 | children?: any
29 | component?: Component | string | keyof JSX.IntrinsicElements
30 | }
31 | ): () => JSX.Element
32 | ```
33 |
34 | Here's an example of how you can use it:
35 |
36 | ```tsx
37 |
38 | ```
39 |
40 | ## Props
41 |
42 | | Name | Type | Description |
43 | | :---------- | :---------------------------------------------------------- | :---------------------------------------- |
44 | | `component` | `Component` \| `string` \| `keyof JSX.IntrinsicElements` | The component to render. |
45 | | `children` | `any` | The children to pass to the component. |
46 | | `...` | `T` | Any other props to pass to the component. |
47 |
--------------------------------------------------------------------------------
/src/routes/solid-start/building-your-application/route-prerendering.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Route Pre-rendering
3 | use_cases: >-
4 | static site generation, ssg, blog sites, documentation, marketing pages,
5 | performance optimization, seo improvement
6 | tags:
7 | - prerender
8 | - ssg
9 | - static
10 | - performance
11 | - build
12 | - seo
13 | version: '1.0'
14 | description: >-
15 | Pre-render SolidStart routes to static HTML for faster loads and better SEO.
16 | Perfect for blogs, docs, and marketing sites.
17 | ---
18 |
19 | Route pre-rendering powers Static Site Generation (SSG) by producing static HTML pages during the build process.
20 | This results in faster load times and better SEO, making it especially useful for content-rich sites such as documentation, blogs, and marketing pages.
21 | Static files are served without server-side processing at runtime.
22 |
23 | Configure prerendering for specific routes using the `routes` option
24 |
25 | ```js { 6 }
26 | import { defineConfig } from "@solidjs/start/config";
27 |
28 | export default defineConfig({
29 | server: {
30 | prerender: {
31 | routes: ["/", "/about"]
32 | }
33 | }
34 | });
35 | ```
36 |
37 | Or to pre-render all routes, you can pass `true` to the `crawlLinks` option
38 |
39 | ```js { 6 }
40 | import { defineConfig } from "@solidjs/start/config";
41 |
42 | export default defineConfig({
43 | server: {
44 | prerender: {
45 | crawlLinks: true
46 | }
47 | }
48 | });
49 | ```
50 |
51 | For advanced pre-rendering options, refer to [Nitro's documentation](https://nitro.build/config#prerender).
52 |
53 | [SolidBase](https://solidbase.dev) simplifies SSG development with built-in support for fast, pre-rendered Markdown and MDX pages.
54 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/map-array.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: mapArray
3 | use_cases: >-
4 | efficient list rendering, dynamic arrays, cached list transformations,
5 | optimized updates, for loop alternatives
6 | tags:
7 | - arrays
8 | - lists
9 | - rendering
10 | - caching
11 | - optimization
12 | version: '1.0'
13 | description: >-
14 | Efficiently map reactive arrays in SolidJS with cached transformations.
15 | Reduces unnecessary re-renders by tracking items by reference.
16 | ---
17 |
18 | ```ts
19 | import { mapArray } from "solid-js"
20 |
21 | function mapArray(
22 | list: () => readonly T[],
23 | mapFn: (v: T, i: () => number) => U
24 | ): () => U[]
25 |
26 | ```
27 |
28 | Reactive map helper that caches each item by reference to reduce unnecessary mapping on updates.
29 | It only runs the mapping function once per value and then moves or removes it as needed.
30 | The index argument is a signal. The map function itself is not tracking.
31 |
32 | Underlying helper for the `` control flow.
33 |
34 | ```ts
35 | const mapped = mapArray(source, (model) => {
36 | const [name, setName] = createSignal(model.name)
37 | const [description, setDescription] = createSignal(model.description)
38 |
39 | return {
40 | id: model.id,
41 | get name() {
42 | return name()
43 | },
44 | get description() {
45 | return description()
46 | },
47 | setName,
48 | setDescription,
49 | }
50 | })
51 | ```
52 |
53 | ## Arguments
54 |
55 | | Name | Type | Description |
56 | | :---- | :----------------------------- | :----------------------- |
57 | | list | `() => readonly T[]` | The source array to map. |
58 | | mapFn | `(v: T, i: () => number) => U` | The mapping function. |
59 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-params.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useParams
3 | use_cases: "dynamic routes, user profiles, product pages, id-based content, url parameters"
4 | tags:
5 | - params
6 | - dynamic
7 | - routes
8 | - parameters
9 | - reactive
10 | version: "1.0"
11 | description: >-
12 | Access route parameters reactively with useParams - extract dynamic segments
13 | from URLs for user profiles, products, and ID-based pages.
14 | ---
15 |
16 | The `useParams` function reads the path parameters of the current route.
17 |
18 | ## Import
19 |
20 | ```ts
21 | import { useParams } from "@solidjs/router";
22 | ```
23 |
24 | ## Type
25 |
26 | ```ts
27 | function useParams>(): T;
28 | ```
29 |
30 | ## Parameters
31 |
32 | `useParams` takes no arguments.
33 |
34 | ## Return value
35 |
36 | - **Type**: `T`
37 |
38 | `useParams` returns a reactive object where keys match the dynamic segments defined in the route path.
39 | Accessing a property within a tracking scope registers a dependency, causing the computation to re-run when the parameter changes.
40 |
41 | ## Examples
42 |
43 | ### Basic usage
44 |
45 | ```ts
46 | import { createMemo } from "solid-js";
47 | import { useParams } from "@solidjs/router";
48 |
49 | // Rendered via
50 | function UserPage() {
51 | const params = useParams();
52 |
53 | // Derived value updates when the route parameter changes.
54 | const title = createMemo(() => `Profile for ${params.id}`);
55 |
56 | return {title()} ;
57 | }
58 | ```
59 |
60 | ## Related
61 |
62 | - [useLocation](/solid-router/reference/primitives/use-location)
63 | - [useSearchParams](/solid-router/reference/primitives/use-search-params)
64 |
--------------------------------------------------------------------------------
/src/routes/guides/deploying-your-app.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Deploy your app
3 | order: 9
4 | use_cases: 'production deployment, hosting, going live, app publishing, cloud deployment'
5 | tags:
6 | - deployment
7 | - hosting
8 | - production
9 | - cloud
10 | - publishing
11 | version: '1.0'
12 | description: >-
13 | Deploy your Solid application to popular hosting platforms including
14 | Cloudflare, Vercel, Netlify, AWS, and more with guides.
15 | ---
16 |
17 | Are you ready to deploy your Solid application? Follow our guides for different deployment services.
18 |
19 |
20 |
21 |
26 |
27 |
32 |
33 |
38 |
39 |
44 |
45 |
50 |
55 |
56 |
61 |
62 |
67 |
68 |
73 |
74 |
--------------------------------------------------------------------------------
/src/routes/reference/component-apis/use-context.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useContext
3 | use_cases: >-
4 | consuming context, accessing global state, avoiding prop drilling, theme
5 | access, auth state, shared data
6 | tags:
7 | - context
8 | - providers
9 | - global-state
10 | - hooks
11 | - consumption
12 | version: '1.0'
13 | description: >-
14 | Access context values with useContext to consume data from parent providers.
15 | Avoid prop drilling and access shared state throughout your component tree.
16 | ---
17 |
18 | Used to grab context within a context provider scope to allow for deep passing of props without having to pass them through each Component function.
19 | It's therefore used in conjunction with [`createContext`](/reference/component-apis/create-context) to consume the data from a Provider scope and thus avoid passing data through intermediate components (prop drilling).
20 |
21 | ```ts
22 | const [state, { increment, decrement }] = useContext(CounterContext)
23 | ```
24 |
25 | ## Recommended usage
26 |
27 | It is often a good idea to wrap `useContext` in a function like so:
28 |
29 | ```ts title="/context/counter-component.tsx"
30 | function useCounterContext() {
31 | const context = useContext(CounterContext)
32 |
33 | if (!context) {
34 | throw new Error("useCounterContext: cannot find a CounterContext")
35 | }
36 |
37 | return context
38 | }
39 | ```
40 |
41 | See the API reference of [createContext](/reference/component-apis/create-context) the API on how to generate a Provider scope.
42 | And check the [Context concepts](/concepts/context) for more information on how to architecture your contexts.
43 |
44 | ## Type signature
45 |
46 | ```ts
47 | import { type Context } from "solid-js"
48 |
49 | function useContext(context: Context): T
50 |
51 | ```
52 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/render-to-string-async.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: renderToStringAsync
3 | use_cases: >-
4 | ssr with async data, suspense resolution, complete page rendering, data
5 | serialization, seo optimization
6 | tags:
7 | - ssr
8 | - async
9 | - suspense
10 | - serialization
11 | - rendering
12 | version: '1.0'
13 | description: >-
14 | Render complete HTML with async data using renderToStringAsync. Waits for all
15 | Suspense boundaries before returning serialized results.
16 | ---
17 |
18 | ```ts
19 | import { renderToStringAsync } from "solid-js/web"
20 |
21 | function renderToStringAsync(
22 | fn: () => T,
23 | options?: {
24 | timeoutMs?: number
25 | renderId?: string
26 | nonce?: string
27 | }
28 | ): Promise
29 |
30 | ```
31 |
32 | Same as `renderToString` except that it will wait for all `` boundaries to resolve before returning the results.
33 | Resource data is automatically serialized into the script tag and will be hydrated on client load.
34 |
35 | `renderId` is used to namespace renders when having multiple top level roots.
36 |
37 | ```ts
38 | const html = await renderToStringAsync(App)
39 | ```
40 |
41 | ## Options
42 |
43 | | Name | Type | Description |
44 | | ----------- | -------- | -------------------------------------------------------------------------------------------- |
45 | | `timeoutMs` | `number` | The number of milliseconds to wait for a `` boundary to resolve before timing out. |
46 | | `renderId` | `string` | The id to use for the render. |
47 | | `nonce` | `string` | The nonce to use for the script tag. |
48 |
--------------------------------------------------------------------------------
/src/utils/route-metadata-helper.ts:
--------------------------------------------------------------------------------
1 | import { useLocation } from "@solidjs/router";
2 | import { SUPPORTED_LOCALES } from "~/i18n/config";
3 |
4 | export enum Project {
5 | Core = "",
6 | Router = "/solid-router",
7 | Start = "/solid-start",
8 | Meta = "/solid-meta",
9 | }
10 |
11 | interface CurrentRouteMetaData {
12 | project: Project | null;
13 | locale: string;
14 | isProjectRoot: boolean;
15 | }
16 |
17 | export const useCurrentRouteMetaData = (): CurrentRouteMetaData => {
18 | let currentPath = useLocation().pathname;
19 |
20 | // Trim trailing slash
21 | currentPath = currentPath.endsWith("/")
22 | ? currentPath.slice(0, -1)
23 | : currentPath;
24 |
25 | const pathParts = currentPath.split("/").filter(Boolean);
26 | const projectOrLocale: string = pathParts[0];
27 |
28 | const returnObject: CurrentRouteMetaData = {
29 | isProjectRoot: true,
30 | locale: "",
31 | project: null,
32 | };
33 |
34 | if (SUPPORTED_LOCALES.includes(projectOrLocale)) {
35 | if (pathParts.length > 2) {
36 | returnObject.isProjectRoot = false;
37 | }
38 |
39 | returnObject.locale = projectOrLocale;
40 | checkPathBeyondLocale(pathParts[1] ?? "");
41 | } else {
42 | if (pathParts.length > 1) {
43 | returnObject.isProjectRoot = false;
44 | }
45 |
46 | checkPathBeyondLocale(pathParts[0] ?? "");
47 | }
48 |
49 | function isInProjectEnum(projectPath: string): boolean {
50 | return Object.values(Project).includes(projectPath as Project);
51 | }
52 |
53 | function checkPathBeyondLocale(path: string) {
54 | if (path.length > 0) {
55 | path = "/" + path;
56 | }
57 |
58 | if (isInProjectEnum(path)) {
59 | returnObject.project = path as Project;
60 | } else {
61 | returnObject.isProjectRoot = false;
62 | returnObject.project = "" as Project;
63 | }
64 | }
65 |
66 | return returnObject;
67 | };
68 |
--------------------------------------------------------------------------------
/src/routes/reference/rendering/render.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: render
3 | use_cases: >-
4 | app initialization, mounting components, spa entry point, client-side
5 | rendering, dom manipulation
6 | tags:
7 | - mounting
8 | - initialization
9 | - spa
10 | - dom
11 | - client
12 | - entry
13 | version: '1.0'
14 | description: >-
15 | Mount your Solid app to the DOM with render. The essential browser entry point
16 | for initializing and disposing client-side applications.
17 | ---
18 |
19 | ```ts
20 | import { render } from "solid-js/web"
21 | import type { JSX } from "solid-js"
22 | import type { MountableElement } from "solid-js/web"
23 |
24 | function render(
25 | code: () => JSX.Element,
26 | element: MountableElement
27 | ): () => void
28 |
29 | ```
30 |
31 | This is the browser app entry point.
32 | Provide a top-level component function and an element to mount to.
33 | It is recommended this element be empty: while `render` will just append children, the returned dispose function will remove all children.
34 |
35 | ```ts
36 | const dispose = render(App, document.getElementById("app"))
37 | // or
38 | const dispose = render(() => , document.getElementById("app"))
39 | ```
40 |
41 | It's important that the first argument is a function: do not pass JSX directly (as in `render( , ...)`), because this will call App before render can set up a root to track signal dependencies within App.
42 |
43 | ## Parameters
44 |
45 | | Argument | Type | Description |
46 | | -------------------- | ------------------- | ----------------------------------------------- |
47 | | code | `() => JSX.Element` | Function that returns the application code. |
48 | | element | MountableElement | DOM Element to mount the application to |
49 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/data-apis/use-action.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useAction
3 | use_cases: >-
4 | programmatic forms, client-side mutations, imperative actions, non-form
5 | submissions
6 | tags:
7 | - actions
8 | - mutations
9 | - client
10 | - imperative
11 | - programmatic
12 | version: '1.0'
13 | description: >-
14 | Invoke actions programmatically without forms using useAction. Perfect for
15 | client-side mutations and imperative updates.
16 | ---
17 |
18 | The `useAction` primitive returns a function that triggers an [action](/solid-router/concepts/actions) when called.
19 |
20 | `useAction` requires client-side JavaScript and is not progressively enhanceable.
21 |
22 | ## Import
23 |
24 | ```tsx
25 | import { useAction } from "@solidjs/router";
26 | ```
27 |
28 | ## Type
29 |
30 | ```tsx
31 | function useAction, U, V>(
32 | action: Action
33 | ): (...args: Parameters>) => Promise>;
34 | ```
35 |
36 | ## Parameters
37 |
38 | ### `action`
39 |
40 | - **Type:** `Action`
41 | - **Required:** Yes
42 |
43 | The action to be triggered.
44 |
45 | ## Return value
46 |
47 | `useAction` returns a function that triggers the action.
48 | It takes the same parameters as the action handler and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves with the action's result.
49 |
50 | ## Example
51 |
52 | ```tsx
53 | import { action, useAction } from "@solidjs/router";
54 |
55 | const likePostAction = action(async (id: string) => {
56 | // ... Likes a post on the server.
57 | });
58 |
59 | function LikeButton(props: { postId: string }) {
60 | const likePost = useAction(likePostAction);
61 |
62 | return likePost(props.postId)}>Like ;
63 | }
64 | ```
65 |
--------------------------------------------------------------------------------
/src/routes/guides/styling-components/less.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: LESS
3 | order: 2
4 | mainNavExclude: true
5 | use_cases: >-
6 | css preprocessing, style variables, mixins, nested styles, programmatic
7 | styling
8 | tags:
9 | - styling
10 | - less
11 | - preprocessor
12 | - variables
13 | - mixins
14 | - css
15 | version: '1.0'
16 | description: >-
17 | Integrate LESS preprocessor in Solid apps for variables, mixins, and
18 | programmatic CSS features to write cleaner stylesheets.
19 | ---
20 |
21 | [LESS](https://lesscss.org/) is a preprocessor based on JavaScript.
22 | It provides the ability to use mixins, variables, and other programmatic tools, making styling code cleaner and less redundant.
23 |
24 | ## Installation
25 |
26 | To utilize LESS in a Solid app, it will need to be installed as a development dependency:
27 |
28 | ```package-install-dev
29 | less
30 | ```
31 |
32 | ## Using LESS in your app
33 |
34 | Start by creating a `.less` file in the `src` directory:
35 |
36 | ```less
37 | //styles.less
38 | .foo {
39 | color: red;
40 | }
41 | .bar {
42 | background-color: blue;
43 | }
44 | ```
45 |
46 | The basic syntax of LESS is very similar to CSS.
47 | However, LESS allows the declaration and usage of variables:
48 |
49 | ```less
50 | //styles.less
51 | @plainred: red;
52 | @plainblue: blue;
53 | .foo {
54 | color: @plainred;
55 | }
56 | .bar {
57 | background-color: @plainblue;
58 | }
59 | ```
60 |
61 | To use these styles in a Solid component, import the `.less` file:
62 |
63 | ```jsx
64 | //component.jsx
65 | import "./styles.less";
66 |
67 | function Component() {
68 | return (
69 | <>
70 | Hello, world!
71 | >
72 | );
73 | }
74 | ```
75 |
76 | By changing the file extension of the imported styles to `.less`, Vite will recognize it as a LESS file and compile it to CSS on demand.
77 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/http-header.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: HttpHeader
3 | use_cases: >-
4 | security headers, cors configuration, cache control, seo headers, custom
5 | headers, api responses
6 | tags:
7 | - headers
8 | - http
9 | - response
10 | - security
11 | - cors
12 | - meta
13 | version: '1.0'
14 | description: >-
15 | Set custom HTTP headers in SolidStart responses. Configure security, caching,
16 | CORS, and SEO headers for server-rendered pages.
17 | ---
18 |
19 | `HttpHeader` provides a way to set headers on HTTPs response sent by the server.
20 |
21 | ```tsx
22 | import { HttpHeader } from "@solidjs/start";
23 |
24 | ;
25 | ```
26 |
27 | ## Setting a header for catch-all routes
28 |
29 | ```tsx title="routes/*404.tsx"
30 | import { HttpHeader, HttpStatusCode } from "@solidjs/start";
31 |
32 | export default function NotFound() {
33 | return (
34 |
35 |
36 |
37 |
38 | );
39 | }
40 | ```
41 |
42 | As a page is rendered, you may want to add additional HTTP headers to the response and the `HttpHeader` component will do that for you.
43 | By passing it a `name` and `value`, they will get added to the `Response` headers sent back to the browser.
44 |
45 | When streaming responses with [`renderToStream`](/reference/rendering/render-to-stream), HTTP headers can only be added before the stream is first flushed.
46 | This requires adding `deferStream` to any resources that need to be loaded before responding.
47 |
48 | ## Parameters
49 |
50 | | Property | Type | Description |
51 | | -------- | ------ | ------------------------------ |
52 | | name | string | The name of the header to set |
53 | | value | string | The value of the header to set |
54 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/untrack.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: untrack
3 | use_cases: >-
4 | static values, initial values, default props, performance optimization,
5 | non-reactive access
6 | tags:
7 | - tracking
8 | - performance
9 | - props
10 | - reactivity
11 | - optimization
12 | - defaults
13 | version: '1.0'
14 | description: >-
15 | Prevent dependency tracking for static values in SolidJS. Optimize performance
16 | by excluding non-updating props from reactive tracking scope.
17 | ---
18 |
19 | Ignores tracking any of the dependencies in the executing code block and returns the value. This helper is useful when a certain `prop` will never update and thus it is ok to use it outside of the tracking scope.
20 |
21 | ```tsx title="component.tsx"
22 | import { untrack } from "solid-js"
23 |
24 | export function Component(props) {
25 | const value = untrack(() => props.value)
26 |
27 | return {value}
28 | }
29 | }
30 | ```
31 |
32 | ## Initial and Default Values
33 |
34 | It is not necessary to manually untrack values that are suppose to serve as a default or initial value to a signal. Even with the linter configured to enforce tracking, the linter will accept it when a `prop` is prefixed with `default` or `initial` as it is a common pattern to use them as such.
35 |
36 |
37 | ```tsx tab title="initialValue" {5}
38 | // component.tsx
39 | import { createSignal } from "solid-js"
40 |
41 | export function Component(props) {
42 | const [name, setName] = createSignal(props.initialName)
43 |
44 | return {name()}
45 | }
46 | }
47 | ```
48 |
49 | ```tsx tab title="defaultValue" {5}
50 | // component.tsx
51 | import { createSignal } from "solid-js"
52 |
53 | export function Component(props) {
54 | const [name, setName] = createSignal(props.defaultName)
55 |
56 | return {name()}
57 | }
58 | }
59 | ```
60 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/server/create-handler.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: createHandler
3 | use_cases: >-
4 | ssr mode configuration, server startup, streaming setup, async rendering,
5 | performance tuning
6 | tags:
7 | - handler
8 | - ssr
9 | - server
10 | - streaming
11 | - async
12 | - rendering
13 | version: '1.0'
14 | description: >-
15 | Configure server-side rendering modes in SolidStart. Choose between sync,
16 | async, or streaming SSR for optimal performance and UX.
17 | ---
18 |
19 | The `createHandler` is used to start the server in [`entry-server.tsx`](/solid-start/reference/entrypoints/entry-server).
20 | It takes a function that returns a static document (often created with [``](/solid-start/reference/server/start-server)), and serves it using one of the three function for server side rendering (SSR):
21 |
22 | - [`renderToString`](/reference/rendering/render-to-string) - "sync"
23 | - [`renderToStringAsync`](/reference/rendering/render-to-string-async) - "async"
24 | - [`renderToStream`](/reference/rendering/render-to-stream) - "stream"
25 |
26 | The SSR mode can be configured through the `mode` property on the options object:
27 |
28 | ```tsx
29 | import { createHandler, StartServer } from "@solidjs/start/server";
30 |
31 | export default createHandler(() => (
32 |
34 | ), {
35 | mode: "async"
36 | });
37 | ```
38 |
39 | ## Parameters
40 |
41 | | Argument | Type | Default | Description |
42 | | ------------ | ------------------------ | -------- | ----------------------------------------------------------------- |
43 | | fn | fn: (context: PageEvent) | | A function that returns the static document for your application. |
44 | | options.mode | string | "stream" | The SSR mode. Options are 'sync', 'async' and 'stream'. |
45 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/components/route.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Route
3 | use_cases: >-
4 | defining routes, app structure, url mapping, component rendering, nested
5 | routing
6 | tags:
7 | - component
8 | - routes
9 | - structure
10 | - paths
11 | - nested
12 | - configuration
13 | version: '1.0'
14 | description: >-
15 | Route component defines your application's URL structure and maps paths to
16 | components with support for multiple paths and nested routing.
17 | ---
18 |
19 | `Route` is the component used when defining the routes of an application.
20 | This component is used to define the structure of the application and the components that will be rendered for each route.
21 |
22 | :::note[Multiple paths]
23 | Routes support defining multiple paths using an array.
24 | This is useful for when you want a route to remain mounted and not re-render when switching between two or more locations that it matches:
25 |
26 | ```jsx
27 |
28 | ```
29 |
30 | This would mean navigating from `/login` to `/register` would not cause the `Login` component to re-render.
31 |
32 | :::
33 |
34 | | prop | type | description |
35 | | ------------ | -------------------- | ----------------------------------------------------------------- |
36 | | path | `string \| string[]` | Path partial for defining the route segment |
37 | | component | `Component` | Component that will be rendered for the matched segment |
38 | | matchFilters | `MatchFilters` | Additional constraints for matching against the route |
39 | | children | `JSX.Element` | Nested `` definitions |
40 | | preload | `RoutePreloadFunc` | Function called during preload or when the route is navigated to. |
41 |
--------------------------------------------------------------------------------
/src/routes/solid-start/advanced/websocket.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: WebSocket endpoint
3 | use_cases: >-
4 | real-time updates, chat applications, live notifications, multiplayer games,
5 | collaborative editing, streaming data
6 | tags:
7 | - websocket
8 | - real-time
9 | - streaming
10 | - experimental
11 | - server
12 | - events
13 | version: '1.0'
14 | description: >-
15 | Set up WebSocket endpoints in SolidStart for real-time bidirectional
16 | communication. Handle connections, messages, and events.
17 | ---
18 |
19 | WebSocket endpoint may be included by passing the ws handler file you specify in your start config.
20 | Note that this feature is [experimental on the Nitro server](https://nitro.build/guide/websocket#opt-in-to-the-experimental-feature) and its config may change in future releases of SolidStart. Use it with caution.
21 |
22 | ```ts title="./app.config.ts"
23 | import { defineConfig } from "@solidjs/start/config";
24 |
25 | export default defineConfig({
26 | server: {
27 | experimental: {
28 | websocket: true,
29 | },
30 | },
31 | }).addRouter({
32 | name: "ws",
33 | type: "http",
34 | handler: "./src/ws.ts",
35 | target: "server",
36 | base: "/ws",
37 | });
38 | ```
39 |
40 | Inside the ws file, you can export an eventHandler function to manage WebSocket connections and events:
41 |
42 | ```tsx title="./src/ws.ts"
43 | import { eventHandler } from "vinxi/http";
44 |
45 | export default eventHandler({
46 | handler() {},
47 | websocket: {
48 | async open(peer) {
49 | console.log("open", peer.id, peer.url);
50 | },
51 | async message(peer, msg) {
52 | const message = msg.text();
53 | console.log("msg", peer.id, peer.url, message);
54 | },
55 | async close(peer, details) {
56 | console.log("close", peer.id, peer.url);
57 | },
58 | async error(peer, error) {
59 | console.log("error", peer.id, peer.url, error);
60 | },
61 | },
62 | });
63 | ```
64 |
--------------------------------------------------------------------------------
/src/routes/solid-start/reference/entrypoints/app.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: app.tsx
3 | use_cases: >-
4 | routing setup, app structure, layout definition, navigation setup, entry point
5 | configuration
6 | tags:
7 | - routing
8 | - app
9 | - entry
10 | - layout
11 | - navigation
12 | - components
13 | version: '1.0'
14 | description: >-
15 | Define your SolidStart app's entry point and routing structure. Set up
16 | navigation, layouts, and isomorphic application logic.
17 | ---
18 |
19 | The `App` component is the isomorphic (shared on server and browser) entry point into your application.
20 | This is where the code runs on both sides.
21 | This is like the classic entry point where you can define your router, and other top level components.
22 |
23 | ## Basic example (with routing)
24 |
25 | This is where routers setup navigation between the pages discovered by the [`FileRouter`](/solid-start/reference/routing/file-routes).
26 |
27 | ```tsx
28 | import { A, Router } from "@solidjs/router";
29 | import { FileRoutes } from "@solidjs/start/router";
30 | import { Suspense } from "solid-js";
31 |
32 | export default function App() {
33 | return (
34 | (
36 | Index
37 | About
38 | {props.children}
39 | )}
40 | >
41 |
42 |
43 | );
44 | }
45 | ```
46 |
47 | See a similar example in [StackBlitz](https://stackblitz.com/github/solidjs/solid-start/tree/main/examples/basic?file=src%2Fapp.tsx)
48 |
49 | ## Bare example (no routing)
50 |
51 | Since SolidStart does not come packaged with a router, you can simply return your template of choice:
52 |
53 | ```tsx
54 | export default function App() {
55 | return (
56 |
57 | Hello world!
58 |
59 | );
60 | }
61 | ```
62 |
63 | See this example in [StackBlitz](https://stackblitz.com/github/solidjs/solid-start/tree/main/examples/bare?file=src%2Fapp.tsx)
64 |
--------------------------------------------------------------------------------
/src/routes/reference/lifecycle/on-cleanup.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: onCleanup
3 | order: 5
4 | use_cases: >-
5 | component unmounting, memory leak prevention, event listener cleanup, side
6 | effect cleanup, resource disposal
7 | tags:
8 | - lifecycle
9 | - cleanup
10 | - memory
11 | - events
12 | - disposal
13 | version: '1.0'
14 | description: >-
15 | Register cleanup methods in SolidJS to prevent memory leaks. Executes when
16 | components unmount or tracking scopes dispose. Essential for proper cleanup.
17 | ---
18 |
19 | `onCleanup` registers a cleanup method that executes on disposal and recalculation of the current tracking scope.
20 | Can be used anywhere to clean up any side effects left behind by initialization.
21 |
22 | When used in a Component, it runs when the component is unmounted.
23 | When used in tracking scope, such [`createEffect`](/reference/basic-reactivity/create-effect), [`createMemo`](/reference/basic-reactivity/create-memo) or a [`createRoot`](/reference/reactive-utilities/create-root), it runs when the tracking scope is disposed or refreshed.
24 |
25 | ```ts
26 | import { onCleanup } from "solid-js"
27 |
28 | function onCleanup(fn: () => void): void;
29 | ```
30 |
31 | Without the `onCleanup` function, the event listener would remain attached to the `document` even after the component is removed from the page.
32 | This can cause memory leaks and other issues.
33 |
34 | ```tsx
35 | import { createSignal, onCleanup } from "solid-js"
36 |
37 | const Component = () => {
38 | const [count, setCount] = createSignal(0);
39 |
40 | const handleClick = () => setCount((value) => value + 1);
41 |
42 | document.addEventListener("click", handleClick);
43 |
44 | /**
45 | * Remove the event listener when the component is removed/unmounted from the page.
46 | */
47 | onCleanup(() => {
48 | document.removeEventListener("click", handleClick);
49 | });
50 |
51 | return Document has been clicked {count()} times ;
52 | };
53 | ```
54 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/primitives/use-match.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: useMatch
3 | use_cases: >-
4 | active links, navigation highlighting, conditional rendering, path matching,
5 | menu items
6 | tags:
7 | - match
8 | - active
9 | - navigation
10 | - path
11 | - conditional
12 | - links
13 | version: '1.0'
14 | description: >-
15 | Check if paths match current route with useMatch - create active navigation
16 | links, conditional rendering based on route matching.
17 | ---
18 |
19 | `useMatch` takes an accessor that returns the path and creates a Memo that returns match information if the current path matches the provided path.
20 | Useful for determining if a given path matches the current route.
21 |
22 | ```js
23 | const match = useMatch(() => props.href);
24 |
25 | return
;
26 | ```
27 |
28 | As a second parameter, `useMatch` also accepts a group of `MatchFilters`.
29 | These filteres allow for a more granular check.
30 |
31 | The filters are the same used by the `` itself and they accept either a an array of strings, or a regular expression. Additionally, there's a `boolean` option to match a route only if it has, or doesn't have, the HTML extension.
32 |
33 | ```js
34 | const filters: MatchFilters = {
35 | parent: ["mom", "dad"]
36 | id: /^\d+$/,
37 | withHtmlExtension: (v: string) => v.length > 5 && v.endsWith(".html")
38 | };
39 | ```
40 |
41 | Finally, any parameter can be determined optional by adding a `?` at the end of the parameter name.
42 |
43 | ```js
44 | const isReference = useMatch(() => "/:project?/reference/*?", {
45 | project: ["solid-router", "solid-meta", "solid-start"],
46 | });
47 | ```
48 |
49 | The check above will match:
50 |
51 | ```text
52 | /reference
53 | /solid-router/reference
54 | /solid-meta/reference
55 | /solid-start/reference
56 |
57 | /reference/...
58 | /solid-router/reference/...
59 | /solid-meta/reference/...
60 | /solid-start/reference/...
61 | ```
62 |
--------------------------------------------------------------------------------
/src/routes/solid-router/reference/data-apis/revalidate.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: revalidate
3 | use_cases: >-
4 | refresh data, invalidate cache, polling, real-time updates, manual refetch,
5 | stale data
6 | tags:
7 | - revalidate
8 | - cache
9 | - refresh
10 | - invalidation
11 | - polling
12 | - refetch
13 | version: '1.0'
14 | description: >-
15 | Manually revalidate cached queries to refresh stale data, implement polling,
16 | or trigger updates after mutations in SolidJS.
17 | ---
18 |
19 | The `revalidate` function is used to revalidate queries associated with specified [query keys](/solid-router/reference/data-apis/query#query-keys).
20 | When a [query](/solid-router/reference/data-apis/query) is revalidated, it is executed again, and any references to the associated query data are updated accordingly.
21 |
22 | ```tsx
23 | import { For } from "solid-js";
24 | import { query, createAsync, revalidate } from "@solidjs/router";
25 |
26 | const getPosts = query(async () => {
27 | return await fetch("https://api.com/posts").then((response) =>
28 | response.json()
29 | );
30 | }, "posts");
31 |
32 | function Posts() {
33 | const posts = createAsync(() => getPosts());
34 |
35 | function refetchPosts() {
36 | revalidate(getPosts.key);
37 | }
38 |
39 | return (
40 |
41 |
Refetch posts
42 |
43 | {(post) => {post.title} }
44 |
45 |
46 | );
47 | }
48 | ```
49 |
50 | ## Parameters
51 |
52 | - `key`: The query key or an array of query keys to be revalidated.
53 | - `force` (optional): A boolean that indicates whether to delete the existing cached value of the queries.
54 | Note that this cache is solely for de-duplication purposes.
55 | Therefore, deleting the cache only affects de-duplication.
56 | For more information on how `query` works, refer to [the `query` documentation](/solid-router/reference/data-apis/query).
57 | The default value is `true`.
58 |
--------------------------------------------------------------------------------
/src/routes/reference/component-apis/create-unique-id.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: createUniqueId
3 | use_cases: >-
4 | form elements, accessibility, aria labels, ssr compatibility, html id
5 | generation, unique identifiers
6 | tags:
7 | - ids
8 | - accessibility
9 | - ssr
10 | - forms
11 | - utilities
12 | version: "1.0"
13 | description: >-
14 | Generate unique IDs that are stable across server and client with
15 | createUniqueId. Essential for accessible forms and SSR-compatible components.
16 | ---
17 |
18 | The `createUniqueId` function generates a unique ID that remains consistent across both server and client renders.
19 | It is commonly used with HTML `id` and `for` attributes to ensure stable hydration.
20 |
21 | `createUniqueId` does *not* generate a cryptographically secure ID and is not suitable for security-sensitive data.
22 | Additionally, it should not be used in scenarios that require uniqueness across a distributed system.
23 |
24 | :::note
25 | `createUniqueId` relies on a counter-based mechanism to generate IDs.
26 | It must be called the same number of times on both the server and client.
27 |
28 | Calling `createUniqueId` only on the server or only on the client, such as when using [`isServer`](/reference/rendering/is-server) or [``](/reference/components/no-hydration), may lead to hydration errors.
29 | :::
30 |
31 | ## Import
32 |
33 | ```ts
34 | import { createUniqueId } from "solid-js";
35 | ```
36 |
37 | ## Type
38 |
39 | ```ts
40 | function createUniqueId(): string;
41 | ```
42 |
43 | ## Parameters
44 |
45 | This function does not take any parameters.
46 |
47 | ## Returns
48 |
49 | `createUniqueId` returns a unique `string` that is stable across server and client renders.
50 |
51 | ## Examples
52 |
53 | ### Basic Usage
54 |
55 | ```tsx
56 | import { createUniqueId } from "solid-js";
57 |
58 | type InputProps = {
59 | id?: string;
60 | };
61 |
62 | function Input(props: InputProps) {
63 | return ;
64 | }
65 | ```
66 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/BUGS.yml:
--------------------------------------------------------------------------------
1 | name: "Bug Report 🪲"
2 | description: Report an issue or possible bug with the functionality of the Solid docs website. (Not related to the content of the site.)
3 | title: "[Bug]: "
4 | labels: [
5 | "bug",
6 | "pending review"
7 | ]
8 | assignees:
9 | - danieljcafonso
10 | - atilafassina
11 |
12 | body:
13 | - type: textarea
14 | id: description
15 | attributes:
16 | label: "📝 Issue Description"
17 | description: Please describe the issue you are experiencing while using the Docs website.
18 | placeholder: Description of your observation...
19 | validations:
20 | required: true
21 | - type: textarea
22 | id: page
23 | attributes:
24 | label: "📋 On which page(s) it occurs"
25 | description: Please indicate on which page(s) the issue occurs.
26 | placeholder: https://docs.solidjs.com/concepts/intro-to-reactivity
27 | validations:
28 | required: true
29 | - type: textarea
30 | id: expected
31 | attributes:
32 | label: "🤔 Expected Behavior"
33 | description: Please describe what the expected behavior should be.
34 | placeholder: When on this page, I expected . . .
35 | validations:
36 | required: true
37 | - type: textarea
38 | id: current
39 | attributes:
40 | label: "👀 Current Behavior"
41 | description: Please describe what the current behavior is.
42 | placeholder: But instead, on this page I'm noticing . . .
43 | validations:
44 | required: true
45 | - type: input
46 | id: browser
47 | attributes:
48 | label: 🖥️ Browser
49 | description: Indicate which browser and version you are using.
50 | placeholder: Chrome X
51 | validations:
52 | required: true
53 | - type: textarea
54 | id: additional
55 | attributes:
56 | label: "📄 Additional Information"
57 | description: Any additional information that may be relevant for the issue.
58 | validations:
59 | required: false
60 |
--------------------------------------------------------------------------------
/src/routes/reference/jsx-attributes/on.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'on:*'
3 | order: 4
4 | use_cases: >-
5 | custom events, non-bubbling events, capture phase handling, passive listeners,
6 | special event options
7 | tags:
8 | - events
9 | - listeners
10 | - dom
11 | - capture
12 | - passive
13 | - handlers
14 | version: '1.0'
15 | description: >-
16 | Attach non-delegated event handlers with on:* in SolidJS. Control capture,
17 | passive, and once options for advanced event handling requirements.
18 | ---
19 |
20 | For events with capital letters, listener options, or if you need to attach event handlers directly to a DOM element instead of optimized delegating via the document, use `on:*` in place of `on*`.
21 |
22 | ```tsx
23 | console.log("Welcome!")} />
24 | ```
25 |
26 | This directly attaches an event handler (via [`addEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)) to the `div`.
27 |
28 | :::note
29 |
New in v1.9.0
30 | :::
31 |
32 | An aditional special syntax that allows full control of [`capture`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#capture), [`passive`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#passive), [`once`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once) and [`signal`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal) is an intersection or combination of `EventListenerObject` & `AddEventListenerOptions`, as follows:
33 |
34 | ```tsx
35 | const handler = {
36 | handleEvent(e) {
37 | console.log(e)
38 | },
39 | once:true,
40 | passive:false,
41 | capture:true
42 | }
43 |
44 |
45 |
46 | // or inline
47 |
48 |
49 | ```
50 |
51 | This new syntax replaces the now deprecated `oncapture:` and it's future proof for any posible new event listener options.
52 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/get-owner.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: getOwner
3 | use_cases: >-
4 | advanced tracking control, custom cleanup logic, understanding component
5 | hierarchy, debugging ownership chains, manual scope management
6 | tags:
7 | - ownership
8 | - tracking
9 | - scopes
10 | - cleanup
11 | - debugging
12 | version: '1.0'
13 | description: >-
14 | Access the current tracking scope owner in SolidJS for advanced control over
15 | cleanup and disposal. Essential for custom reactive primitives.
16 | ---
17 |
18 | ```tsx
19 | import { getOwner } from "solid-js"
20 | import type { Owner } from "solid-js"
21 |
22 | function getOwner(): Owner
23 |
24 | ```
25 |
26 | Gets the tracking scope that owns the currently running code, e.g., for passing into a later call to `runWithOwner` outside of the current scope.
27 |
28 | Internally, computations (effects, memos, etc.) create owners which are children of their owner, all the way up to the root owner created by `createRoot` or `render`.
29 | In particular, this ownership tree lets Solid automatically clean up a disposed computation by traversing its subtree and calling all `onCleanup` callbacks.
30 | For example, when a createEffect's dependencies change, the effect calls all descendant `onCleanup` callbacks before running the effect function again.
31 | Calling `getOwner` returns the current owner node that is responsible for disposal of the current execution block.
32 |
33 | Components are not computations, so do not create an owner node, but they are typically rendered from a `createEffect` which does, so the result is similar: when a component gets unmounted, all descendant `onCleanup` callbacks get called.
34 | Calling `getOwner` from a component scope returns the owner that is responsible for rendering and unmounting that component.
35 |
36 | Note that the owning tracking scope isn't necessarily tracking.
37 | For example, untrack turns off tracking for the duration of a function (without creating a new tracking scope), as do components created via JSX (`
`).
38 |
--------------------------------------------------------------------------------
/src/routes/concepts/derived-values/derived-signals.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Derived signals
3 | order: 1
4 | use_cases: >-
5 | computed values, reactive calculations, dependent state, dynamic values from
6 | signals
7 | tags:
8 | - signals
9 | - reactivity
10 | - derived
11 | - computed
12 | - state
13 | version: '1.0'
14 | description: >-
15 | Create reactive derived values that automatically update when their
16 | dependencies change using Solid's derived signals.
17 | ---
18 |
19 | Derived signals are functions that rely on one or more [signals](/concepts/signals) to produce a value.
20 |
21 | These functions are not executed immediately, but instead are only called when the values they rely on are changed.
22 | When the underlying signal is changed, the function will be called again to produce a new value.
23 |
24 | ```js
25 | const double = () => count() * 2;
26 | ```
27 |
28 | In the above example, the `double` function relies on the `count` signal to produce a value.
29 | When the `count` signal is changed, the `double` function will be called again to produce a new value.
30 |
31 | Similarly you can create a derived signal that relies on a store value because stores use signals under the hood.
32 | To learn more about how stores work, [you can visit the stores section](/concepts/stores).
33 |
34 | ```js
35 | const fullName = () => store.firstName + ' ' + store.lastName;
36 | ```
37 |
38 | These dependent functions gain reactivity from the signal they access, ensuring that changes in the underlying data propagate throughout your application.
39 | It is important to note that these functions do not store a value themselves; instead, they can update any effects or components that depend on them.
40 | If included within a component's body, these derived signals will trigger an update when necessary.
41 |
42 | While you can create derived values in this manner, Solid created the [`createMemo`](/reference/basic-reactivity/create-memo) primitive.
43 | To dive deeper into how memos work, [check out the memos section](/concepts/derived-values/memos).
44 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/from.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: from
3 | use_cases: >-
4 | rxjs interop, svelte stores integration, external observables, third-party
5 | state management, converting subscriptions to signals
6 | tags:
7 | - interop
8 | - rxjs
9 | - observables
10 | - signals
11 | - integration
12 | version: '1.0'
13 | description: >-
14 | Convert RxJS observables and external producers into SolidJS signals. Seamless
15 | integration with third-party reactive libraries and state managers.
16 | ---
17 |
18 | ```tsx
19 | import { from } from "solid-js"
20 |
21 | function from(
22 | producer:
23 | | ((setter: (v: T) => T) => () => void)
24 | | {
25 | subscribe: (
26 | fn: (v: T) => void
27 | ) => (() => void) | { unsubscribe: () => void }
28 | }
29 | ): () => T | undefined
30 |
31 | ```
32 |
33 | A helper to make it easier to interop with external producers like RxJS observables or with Svelte Stores.
34 | This basically turns any subscribable (object with a subscribe method) into a Signal and manages subscription and disposal.
35 |
36 | ```tsx
37 | const signal = from(obsv$)
38 | ```
39 |
40 | It can also take a custom producer function where the function is passed a setter function that returns an unsubscribe function:
41 |
42 | ```tsx
43 | const clock = from((set) => {
44 | const interval = setInterval(() => {
45 | set((v) => v + 1)
46 | }, 1000)
47 |
48 | return () => clearInterval(interval)
49 | })
50 | ```
51 |
52 | ## Arguments
53 |
54 | | Name | Type | Description |
55 | | :------- | :----------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- |
56 | | producer | `((setter: (v: T) => T) => () => void) \| { subscribe: (fn: (v: T) => void) => (() => void) \| { unsubscribe: () => void }; }` | The producer function or subscribable object |
57 |
--------------------------------------------------------------------------------
/src/routes/reference/reactive-utilities/split-props.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: splitProps
3 | use_cases: >-
4 | prop forwarding, component composition, prop separation, child components,
5 | prop destructuring
6 | tags:
7 | - props
8 | - components
9 | - composition
10 | - destructuring
11 | - reactive
12 | version: '1.0'
13 | description: >-
14 | Split reactive props objects by keys in SolidJS. Perfect for consuming
15 | specific props while forwarding others to child components efficiently.
16 | ---
17 |
18 | ```ts
19 | import { splitProps } from "solid-js"
20 |
21 | function splitProps(
22 | props: T,
23 | ...keys: Array<(keyof T)[]>
24 | ): [...parts: Partial]
25 |
26 | ```
27 |
28 | Splits a reactive object by keys.
29 |
30 | It takes a reactive object and any number of arrays of keys; for each array of keys, it will return a reactive object with just those properties of the original object.
31 | The last reactive object in the returned array will have any leftover properties of the original object.
32 |
33 | This can be useful if you want to consume a subset of props and pass the rest to a child.
34 |
35 | ```tsx
36 | function MyComponent(props) {
37 | const [local, others] = splitProps(props, ["children"])
38 |
39 | return (
40 | <>
41 | {local.children}
42 |
43 | >
44 | )
45 | }
46 | ```
47 |
48 | Because `splitProps` takes any number of arrays, we can split a props object as much as we wish (if, for example, we had multiple child components that each required a subset of the props).
49 |
50 | Let's say a component was passed six props:
51 |
52 | ```tsx
53 |
54 | // ...
55 |
56 | function MyComponent(props) {
57 | console.log(props) // {a: 1, b: 2, c: 3, d: 4, e: 5, foo: "bar"}
58 | const [vowels, consonants, leftovers] = splitProps(
59 | props,
60 | ["a", "e"],
61 | ["b", "c", "d"]
62 | )
63 | console.log(vowels) // {a: 1, e: 5}
64 | console.log(consonants) // {b: 2, c: 3, d: 4}
65 | console.log(leftovers.foo) // bar
66 | }
67 | ```
68 |
--------------------------------------------------------------------------------