void 0.1.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_PROMPT.md +15 -0
- package/README.md +62 -123
- package/dist/auth-BdsJ0Aff.d.mts +43 -0
- package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
- package/dist/auth-migrations-BAtAck2g.mjs +117 -0
- package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
- package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
- package/dist/cache-W82I8ihI.mjs +47 -0
- package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
- package/dist/cf-access-Dee5cXxL.mjs +22 -0
- package/dist/chunk-DJd-R1mw.mjs +34 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +1807 -0
- package/dist/client-snXOjrp1.mjs +565 -0
- package/dist/collect-CjeZgz5D.mjs +55 -0
- package/dist/config-BIa9HwVX.mjs +573 -0
- package/dist/config-BzM9Dy7T.mjs +37 -0
- package/dist/config-CvHtTM0q.mjs +30 -0
- package/dist/create-project-BIA15W7z.mjs +90 -0
- package/dist/db-DsRoMcfN.mjs +895 -0
- package/dist/defer-DcxEsVH1.mjs +49 -0
- package/dist/delete-DAP6yDc7.mjs +64 -0
- package/dist/deploy-BPKblFx6.mjs +2424 -0
- package/dist/discover-B7FkXBLB.mjs +40 -0
- package/dist/dist-DUyXJLkq.mjs +2667 -0
- package/dist/dist-Dayj3gCK.mjs +1287 -0
- package/dist/domain-BGofcQ6I.mjs +79 -0
- package/dist/dotenv-DwO4ti0Z.mjs +173 -0
- package/dist/drizzle-NnudE_UN.mjs +232 -0
- package/dist/env-CyG3tvU0.mjs +301 -0
- package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
- package/dist/env-raw-BDL4TvdN.mjs +32 -0
- package/dist/env-types-DknSA4SO.mjs +64 -0
- package/dist/env-validation-DJKjR_8q.mjs +163 -0
- package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
- package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
- package/dist/gen-U0Ktr4Zd.mjs +761 -0
- package/dist/handler-B0ds0OHJ.d.mts +269 -0
- package/dist/head-P-egrtFE.d.mts +45 -0
- package/dist/headers-DCXc7mDs.mjs +279 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.mjs +4695 -0
- package/dist/init-C7wS5iGP.mjs +2625 -0
- package/dist/link-p2R6NbgN.mjs +49 -0
- package/dist/list-Bfel-QLc.mjs +113 -0
- package/dist/log-DXdqnmhF.mjs +26 -0
- package/dist/login-CkcXUiIu.mjs +72 -0
- package/dist/logs-DmkrRvx6.mjs +98 -0
- package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
- package/dist/mcp-CaQzfeUi.mjs +373 -0
- package/dist/node-DDfXj10V.mjs +54 -0
- package/dist/output-BwlcIYSR.mjs +139 -0
- package/dist/pages/client.d.mts +198 -0
- package/dist/pages/client.mjs +980 -0
- package/dist/pages/head-client.d.mts +15 -0
- package/dist/pages/head-client.mjs +90 -0
- package/dist/pages/head.d.mts +2 -0
- package/dist/pages/head.mjs +112 -0
- package/dist/pages/index.d.mts +38 -0
- package/dist/pages/index.mjs +76 -0
- package/dist/pages/islands-plugin.d.mts +50 -0
- package/dist/pages/islands-plugin.mjs +195 -0
- package/dist/pages/prefetch.d.mts +31 -0
- package/dist/pages/prefetch.mjs +90 -0
- package/dist/pages/protocol.d.mts +3 -0
- package/dist/pages/protocol.mjs +193 -0
- package/dist/pages/serialize.d.mts +10 -0
- package/dist/pages/serialize.mjs +14 -0
- package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
- package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
- package/dist/prepare-BAtWufvm.mjs +99 -0
- package/dist/preset-D4I73kT4.mjs +221 -0
- package/dist/project-TqORyHn8.mjs +72 -0
- package/dist/project-cmd-B7lQp3F3.mjs +67 -0
- package/dist/project-slug-CKam8lF9.mjs +11 -0
- package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
- package/dist/protocol-BWzXs2A2.d.mts +34 -0
- package/dist/providers-B3aMxWzP.mjs +67 -0
- package/dist/resolve-project-Br5BR03U.mjs +29 -0
- package/dist/rollback-gyC59l7U.mjs +92 -0
- package/dist/route-types-DReF1gUY.mjs +255 -0
- package/dist/routes-stub.d.mts +55 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/runner-6Ep3fNQu.mjs +123 -0
- package/dist/runner-pg-D0wWHYnr.mjs +57 -0
- package/dist/runtime/ai.d.mts +127 -0
- package/dist/runtime/ai.mjs +348 -0
- package/dist/runtime/auth-client-react.d.mts +8 -0
- package/dist/runtime/auth-client-react.mjs +6 -0
- package/dist/runtime/auth-client-solid.d.mts +8 -0
- package/dist/runtime/auth-client-solid.mjs +6 -0
- package/dist/runtime/auth-client-svelte.d.mts +8 -0
- package/dist/runtime/auth-client-svelte.mjs +6 -0
- package/dist/runtime/auth-client-vue.d.mts +8 -0
- package/dist/runtime/auth-client-vue.mjs +6 -0
- package/dist/runtime/auth-client.d.mts +8 -0
- package/dist/runtime/auth-client.mjs +6 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +22 -0
- package/dist/runtime/better-auth-pg.d.mts +11 -0
- package/dist/runtime/better-auth-pg.mjs +51 -0
- package/dist/runtime/better-auth.d.mts +11 -0
- package/dist/runtime/better-auth.mjs +33 -0
- package/dist/runtime/client.d.mts +6 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +30 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/env-helpers.d.mts +2 -0
- package/dist/runtime/env-helpers.mjs +173 -0
- package/dist/runtime/env-public-client.d.mts +22 -0
- package/dist/runtime/env-public-client.mjs +54 -0
- package/dist/runtime/env-public.d.mts +143 -0
- package/dist/runtime/env-public.mjs +366 -0
- package/dist/runtime/env.d.mts +13 -0
- package/dist/runtime/env.mjs +51 -0
- package/dist/runtime/fetch-stream.d.mts +51 -0
- package/dist/runtime/fetch-stream.mjs +81 -0
- package/dist/runtime/fetch.d.mts +59 -0
- package/dist/runtime/fetch.mjs +18 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +85 -0
- package/dist/runtime/isr.d.mts +26 -0
- package/dist/runtime/isr.mjs +43 -0
- package/dist/runtime/kv.d.mts +48 -0
- package/dist/runtime/kv.mjs +106 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +31 -0
- package/dist/runtime/migration-handler-pg.d.mts +6 -0
- package/dist/runtime/migration-handler-pg.mjs +85 -0
- package/dist/runtime/migration-handler.d.mts +19 -0
- package/dist/runtime/migration-handler.mjs +92 -0
- package/dist/runtime/queues.d.mts +7 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +15 -0
- package/dist/runtime/remote/binding-handler.mjs +208 -0
- package/dist/runtime/remote/index.d.mts +8 -0
- package/dist/runtime/remote/index.mjs +461 -0
- package/dist/runtime/response.d.mts +14 -0
- package/dist/runtime/response.mjs +30 -0
- package/dist/runtime/sandbox.d.mts +17 -0
- package/dist/runtime/sandbox.mjs +19 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +30 -0
- package/dist/runtime/seed.mjs +6 -0
- package/dist/runtime/storage.d.mts +7 -0
- package/dist/runtime/storage.mjs +14 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +72 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +296 -0
- package/dist/runtime/ws.d.mts +123 -0
- package/dist/runtime/ws.mjs +103 -0
- package/dist/scan-Ba4hFwlH.mjs +324 -0
- package/dist/scan-C6HMEIdW.mjs +318 -0
- package/dist/secret-CeRSukgM.mjs +109 -0
- package/dist/skills-ipldjlKE.mjs +62 -0
- package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
- package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
- package/dist/sveltekit.d.mts +20 -0
- package/dist/sveltekit.mjs +61 -0
- package/dist/types-mHOEwpW4.d.mts +57 -0
- package/dist/validate-CaMavMxu.mjs +146 -0
- package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
- package/getting-started-prompt.txt +26 -0
- package/package.json +322 -30
- package/schema.json +364 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/SKILL.md +75 -0
- package/skills/void/command/void.md +7 -0
- package/skills/void/docs/guide/ai.md +235 -0
- package/skills/void/docs/guide/app-types.md +103 -0
- package/skills/void/docs/guide/auth.md +257 -0
- package/skills/void/docs/guide/database/d1.md +106 -0
- package/skills/void/docs/guide/database/postgresql.md +106 -0
- package/skills/void/docs/guide/database.md +418 -0
- package/skills/void/docs/guide/deployment.md +98 -0
- package/skills/void/docs/guide/edge/headers.md +79 -0
- package/skills/void/docs/guide/edge/prerendering.md +83 -0
- package/skills/void/docs/guide/edge/redirects.md +116 -0
- package/skills/void/docs/guide/edge/revalidation.md +131 -0
- package/skills/void/docs/guide/edge/rewrites.md +354 -0
- package/skills/void/docs/guide/edge/static-assets.md +72 -0
- package/skills/void/docs/guide/env-vars.md +298 -0
- package/skills/void/docs/guide/index.md +80 -0
- package/skills/void/docs/guide/jobs.md +91 -0
- package/skills/void/docs/guide/kv.md +107 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
- package/skills/void/docs/guide/pages-routing/head.md +130 -0
- package/skills/void/docs/guide/pages-routing/islands.md +405 -0
- package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
- package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
- package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
- package/skills/void/docs/guide/pages-routing/overview.md +236 -0
- package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
- package/skills/void/docs/guide/queues.md +140 -0
- package/skills/void/docs/guide/quickstart.md +233 -0
- package/skills/void/docs/guide/remote-dev.md +67 -0
- package/skills/void/docs/guide/sandboxes.md +82 -0
- package/skills/void/docs/guide/server-routing.md +246 -0
- package/skills/void/docs/guide/ssg.md +74 -0
- package/skills/void/docs/guide/ssr.md +105 -0
- package/skills/void/docs/guide/storage.md +67 -0
- package/skills/void/docs/guide/type-safety.md +179 -0
- package/skills/void/docs/guide/typed-fetch.md +113 -0
- package/skills/void/docs/guide/websockets.md +190 -0
- package/skills/void/docs/index.md +48 -0
- package/skills/void/docs/integrations/agents.md +84 -0
- package/skills/void/docs/integrations/cloudflare.md +284 -0
- package/skills/void/docs/integrations/frameworks/analog.md +182 -0
- package/skills/void/docs/integrations/frameworks/astro.md +197 -0
- package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
- package/skills/void/docs/integrations/frameworks/overview.md +136 -0
- package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
- package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
- package/skills/void/docs/integrations/hono.md +97 -0
- package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
- package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
- package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
- package/skills/void/docs/node_modules/vitepress/README.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
- package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
- package/skills/void/docs/node_modules/void/README.md +89 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
- package/skills/void/docs/reference/api.md +917 -0
- package/skills/void/docs/reference/cli.md +561 -0
- package/skills/void/docs/reference/config.md +408 -0
- package/skills/void/docs/reference/resource-inference.md +149 -0
- package/skills/void/docs/reference/structure.md +176 -0
- package/.npmignore +0 -29
- package/.travis.yml +0 -9
- package/favicon.ico +0 -0
- package/index.js +0 -14
- package/lib/Job.js +0 -150
- package/lib/Void.js +0 -99
- package/lib/scan.js +0 -19
- package/test/credentials.js +0 -20
- package/test/job.js +0 -64
- package/test/static/dir1/test6.html +0 -0
- package/test/static/dir2/test7.html +0 -0
- package/test/static/dir2/test8.html +0 -0
- package/test/static/dir2/test9.html +0 -0
- package/test/static/test1.html +0 -0
- package/test/static/test2.html +0 -0
- package/test/static/test3.html +0 -0
- package/test/void.js +0 -31
- /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
- /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Node.js, Bun, and Deno
|
|
6
|
+
|
|
7
|
+
Void apps default to Cloudflare Workers, but you can target Node.js, Bun, or Deno instead by setting `target` in `void.json`. This is useful when you want to deploy to a traditional server, run in a container, or use a runtime that isn't Cloudflare.
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{ "target": "node" }
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Supported Targets
|
|
14
|
+
|
|
15
|
+
| Target | Server | Static Assets |
|
|
16
|
+
| -------- | ------------------------------------------------------------------------- | -------------------------------- |
|
|
17
|
+
| `"node"` | [`@hono/node-server`](https://github.com/honojs/node-server) | `@hono/node-server/serve-static` |
|
|
18
|
+
| `"bun"` | [`Bun.serve()`](https://bun.sh/docs/api/http) | `hono/bun` |
|
|
19
|
+
| `"deno"` | [`Deno.serve()`](https://docs.deno.com/runtime/fundamentals/http_server/) | `hono/deno` |
|
|
20
|
+
|
|
21
|
+
All three produce the same project structure and use the same Hono-based routing. The only difference is the HTTP server and static file middleware.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
|
|
25
|
+
### 1. Configure the target
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
// void.json
|
|
29
|
+
{ "target": "node" }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Install the server dependency (Node.js only)
|
|
33
|
+
|
|
34
|
+
Node.js requires `@hono/node-server` as an additional dependency. Bun and Deno use their built-in HTTP servers.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @hono/node-server
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. Develop
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx vite dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The dev server runs your Hono routes in Node.js through Vite's SSR module loading. You get the same hot-reload experience as the Cloudflare target, but without `workerd`.
|
|
47
|
+
|
|
48
|
+
### 4. Build and run
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx vite build
|
|
52
|
+
node dist/ssr/index.js
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For Bun:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bunx vite build
|
|
59
|
+
bun dist/ssr/index.js
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For Deno:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
deno run -A npm:vite build
|
|
66
|
+
deno run -A dist/ssr/index.js
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The server listens on `PORT` (env variable) or `3000` by default.
|
|
70
|
+
|
|
71
|
+
## Build Output
|
|
72
|
+
|
|
73
|
+
The build produces two entry points:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
dist/
|
|
77
|
+
ssr/
|
|
78
|
+
app.js ← Hono app with static asset middleware (default export)
|
|
79
|
+
index.js ← imports app.js and starts the HTTP server
|
|
80
|
+
client/ ← static assets (pages mode only)
|
|
81
|
+
assets/
|
|
82
|
+
...
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **`app.js`:** exports the Hono app instance. Use it for programmatic embedding, testing, or custom server setups.
|
|
86
|
+
- **`index.js`:** imports `app.js` and starts the server. This is what you run in production.
|
|
87
|
+
|
|
88
|
+
`vite preview` also uses `app.js` to serve your built app locally.
|
|
89
|
+
|
|
90
|
+
## What Works
|
|
91
|
+
|
|
92
|
+
These Void features work identically across all targets:
|
|
93
|
+
|
|
94
|
+
- [File-based routing](../guide/server-routing.md) (`routes/`, `middleware/`)
|
|
95
|
+
- [Pages mode](../guide/pages-routing/overview.md) with SSR (React, Vue, Svelte, Solid)
|
|
96
|
+
- [Typed fetch client](../guide/typed-fetch.md) (`void/client`)
|
|
97
|
+
- [Custom headers](../guide/edge/headers.md) (`routing.headers`)
|
|
98
|
+
- [Redirects](../guide/edge/redirects.md) (`routing.redirects`)
|
|
99
|
+
- [Environment variables](../guide/env-vars.md) (`.env` files)
|
|
100
|
+
- [Static site generation](../guide/ssg.md)
|
|
101
|
+
- [Vite preview](https://vite.dev/guide/cli#vite-preview) for testing production builds locally
|
|
102
|
+
|
|
103
|
+
## What's Different
|
|
104
|
+
|
|
105
|
+
### No Cloudflare bindings
|
|
106
|
+
|
|
107
|
+
The following imports are **not available** with a non-CF target and produce a compile-time error:
|
|
108
|
+
|
|
109
|
+
| Import | CF Feature |
|
|
110
|
+
| -------------- | ---------------------------- |
|
|
111
|
+
| `void/db` | D1 (SQL database) |
|
|
112
|
+
| `void/kv` | KV (key-value storage) |
|
|
113
|
+
| `void/storage` | R2 (blob storage) |
|
|
114
|
+
| `void/auth` | Void-managed Better Auth |
|
|
115
|
+
| `void/ai` | Workers AI |
|
|
116
|
+
| `void/env` | CF env type augmentation |
|
|
117
|
+
| `void/ws` | Durable Objects + WebSockets |
|
|
118
|
+
|
|
119
|
+
If you need a database or storage, use an external provider and connect via standard Node.js libraries.
|
|
120
|
+
|
|
121
|
+
### No cron job runtime
|
|
122
|
+
|
|
123
|
+
You can still define [cron jobs](../guide/jobs.md) in `crons/` and they will compile into the bundle, but there is no built-in scheduler to invoke them. On Cloudflare, Workers Cron Triggers call the `scheduled` handler automatically. On Node.js, you'll need an external scheduler (e.g. `node-cron`, systemd timers, or your hosting platform's cron) to trigger the exported handler.
|
|
124
|
+
|
|
125
|
+
### No prerendering
|
|
126
|
+
|
|
127
|
+
[Prerendering](../guide/edge/prerendering.md) is a platform feature that relies on Cloudflare's edge cache and the Void deploy pipeline. It is not available for non-CF targets.
|
|
128
|
+
|
|
129
|
+
### No `void deploy`
|
|
130
|
+
|
|
131
|
+
The `void deploy` CLI deploys to the Void platform on Cloudflare. For non-CF targets, build with `vite build` and deploy the `dist/` directory using your hosting provider's workflow, whether that is Docker, systemd, PM2, Fly.io, Railway, or any other Node.js host.
|
|
132
|
+
|
|
133
|
+
### Ignored config fields
|
|
134
|
+
|
|
135
|
+
These `void.json` fields are silently ignored (with a warning) when using a non-CF target:
|
|
136
|
+
|
|
137
|
+
- `inference.bindings`: Cloudflare binding configuration
|
|
138
|
+
- `remote`: remote binding proxy
|
|
139
|
+
- `worker`: Cloudflare-specific config
|
|
140
|
+
- `routing.revalidate`: edge caching, only on Cloudflare
|
|
141
|
+
|
|
142
|
+
If you enable auth through `void/auth`, `void/client`, or `auth.ts`, Void fails the build for non-CF targets. Use Better Auth directly for Node/Bun/Deno deployments.
|
|
143
|
+
|
|
144
|
+
## Example: API + Pages
|
|
145
|
+
|
|
146
|
+
A typical Node.js Void app with API routes and React pages:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
my-app/
|
|
150
|
+
pages/
|
|
151
|
+
layout.tsx
|
|
152
|
+
index.tsx
|
|
153
|
+
index.server.ts
|
|
154
|
+
about.tsx
|
|
155
|
+
about.server.ts
|
|
156
|
+
routes/
|
|
157
|
+
api/
|
|
158
|
+
hello.ts
|
|
159
|
+
package.json
|
|
160
|
+
vite.config.ts
|
|
161
|
+
void.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
// void.json
|
|
166
|
+
{ "target": "node" }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
// vite.config.ts
|
|
171
|
+
import { defineConfig } from 'vite';
|
|
172
|
+
import { voidPlugin } from 'void';
|
|
173
|
+
import { voidReact } from '@void/react/plugin';
|
|
174
|
+
|
|
175
|
+
export default defineConfig({
|
|
176
|
+
plugins: [voidPlugin(), voidReact()],
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
// routes/api/hello.ts
|
|
182
|
+
import { defineHandler } from 'void';
|
|
183
|
+
|
|
184
|
+
export const GET = defineHandler((c) => {
|
|
185
|
+
return c.json({ message: 'Hello from Node.js!' });
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Development
|
|
191
|
+
npx vite dev
|
|
192
|
+
|
|
193
|
+
# Production
|
|
194
|
+
npx vite build
|
|
195
|
+
node dist/ssr/index.js
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Programmatic Usage
|
|
199
|
+
|
|
200
|
+
Since `app.js` exports the Hono app, you can import it into a custom server:
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
import app from './dist/ssr/app.js';
|
|
204
|
+
|
|
205
|
+
// Use with any Node.js HTTP framework
|
|
206
|
+
const response = await app.fetch(new Request('http://localhost/api/hello'));
|
|
207
|
+
console.log(await response.json()); // { message: "Hello from Node.js!" }
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
This is useful for testing, embedding in Express/Fastify, or running in serverless environments that accept a `fetch` handler.
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
# Iconify for Vue
|
|
2
|
+
|
|
3
|
+
Iconify for Vue is not yet another icon component! There are many of them already.
|
|
4
|
+
|
|
5
|
+
What you get with other components:
|
|
6
|
+
|
|
7
|
+
- Limited set of icons.
|
|
8
|
+
- Large bundle size because all icons are bundled.
|
|
9
|
+
|
|
10
|
+
Iconify icon component is nothing like that. Component does not include any icon data, it is not tied to any specific icon set. Instead, all data is retrieved from public API on demand.
|
|
11
|
+
|
|
12
|
+
That means:
|
|
13
|
+
|
|
14
|
+
- One syntax for over 200,000 icons from 150+ icon sets.
|
|
15
|
+
- Renders SVG. Many components simply render icon fonts, which look ugly. Iconify renders pixel perfect SVG.
|
|
16
|
+
- Loads icons on demand. No need to bundle icons, component will automatically load icon data for icons that you use from Iconify API.
|
|
17
|
+
|
|
18
|
+
For more information about Iconify project visit [https://iconify.design/](https://iconify.design/).
|
|
19
|
+
|
|
20
|
+
For extended documentation visit [Iconify for Vue documentation](https://iconify.design/docs/icon-components/vue/).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
If you are using NPM:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install --save-dev @iconify/vue
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If you are using Yarn:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn add --dev @iconify/vue
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Vue 2 compatibility
|
|
37
|
+
|
|
38
|
+
This component is not backwards compatible with Vue 2.
|
|
39
|
+
|
|
40
|
+
If you are using Vue 2, you need to install `@iconify/vue2` component. It is almost identical to this component, but for Vue 2.
|
|
41
|
+
|
|
42
|
+
See [Iconify for Vue 2 documentation](https://iconify.design/docs/icon-components/vue2/).
|
|
43
|
+
|
|
44
|
+
## Usage with API
|
|
45
|
+
|
|
46
|
+
Install `@iconify/vue` and import `Icon` from it:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { Icon } from '@iconify/vue';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Then use `Icon` component in template with icon name or data as "icon" parameter:
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
<Icon icon="mdi-light:home" />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Component will automatically retrieve data for "mdi-light:home" from Iconify API and render it. There are over 200,000 icons available on Iconify API from various free and open source icon sets, including all the most popular icon sets.
|
|
59
|
+
|
|
60
|
+
## Offline usage
|
|
61
|
+
|
|
62
|
+
This icon component is designed to be used with Iconify API, loading icon data on demand instead of bundling it.
|
|
63
|
+
|
|
64
|
+
If you want to use icons without Iconify API, [there are many other options available](https://iconify.design/docs/usage/).
|
|
65
|
+
|
|
66
|
+
## Web component
|
|
67
|
+
|
|
68
|
+
If you are experiencing issues with SSR hydration, there is an alternative solution available: [Iconify Icon web component](https://iconify.design/docs/iconify-icon/).
|
|
69
|
+
|
|
70
|
+
Web component is preferred to this component if:
|
|
71
|
+
|
|
72
|
+
- Your page is performing slowly. Web component separates icon rendering in shadow DOM, improving performance.
|
|
73
|
+
- You are experiencing CSS conflicts.
|
|
74
|
+
- It works better with Nuxt and Vitepress.
|
|
75
|
+
|
|
76
|
+
## Icon Names
|
|
77
|
+
|
|
78
|
+
Icon name is a string. Few examples:
|
|
79
|
+
|
|
80
|
+
- `@api-provider:icon-set-prefix:icon-name`
|
|
81
|
+
- `mdi-light:home` (in this example API provider is empty, so it is skipped)
|
|
82
|
+
|
|
83
|
+
It has 3 parts, separated by ":":
|
|
84
|
+
|
|
85
|
+
- provider points to API source. Starts with "@", can be empty (empty value is used for public Iconify API).
|
|
86
|
+
- prefix is name of icon set.
|
|
87
|
+
- name is name of icon.
|
|
88
|
+
|
|
89
|
+
See [Iconify for Vue icon names documentation](https://iconify.design/docs/icon-components/vue/icon-name.html) for more detailed explanation.
|
|
90
|
+
|
|
91
|
+
## Using icon data
|
|
92
|
+
|
|
93
|
+
Instead of icon name, you can pass icon data to component:
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<template>
|
|
97
|
+
<Icon :icon="icons.chart" height="24" />
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script lang="ts">
|
|
101
|
+
import { Icon } from '@iconify/vue';
|
|
102
|
+
import areaChartOutlined from '@iconify-icons/ant-design/area-chart-outlined';
|
|
103
|
+
|
|
104
|
+
export default {
|
|
105
|
+
components: {
|
|
106
|
+
Icon,
|
|
107
|
+
},
|
|
108
|
+
data() {
|
|
109
|
+
return {
|
|
110
|
+
// Assign icon data to icons.chart
|
|
111
|
+
icons: {
|
|
112
|
+
chart: areaChartOutlined,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
</script>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
See [icon packages documentation](https://iconify.design/docs/icons/) for more details.
|
|
121
|
+
|
|
122
|
+
### ES / CommonJS packages
|
|
123
|
+
|
|
124
|
+
Example above might currently fail with some use cases. Package `@iconify-icons/mdi-light` uses ES modules that some software might not support yet. But do not worry, there is a simple solution: switch to CommonJS icon packages.
|
|
125
|
+
|
|
126
|
+
To switch to CommonJS package, replace this line in example above:
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
import home from '@iconify-icons/mdi-light/home';
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
with
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
import home from '@iconify/icons-mdi-light/home';
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
All icons are available as ES modules for modern bundler and as CommonJS modules for outdated bundlers. ES modules use format `@iconify-icons/{prefix}`, CommonJS modules use `@iconify/icons-{prefix}`.
|
|
139
|
+
|
|
140
|
+
For more details, see [icon packages documentation](https://iconify.design/docs/icons/).
|
|
141
|
+
|
|
142
|
+
### Vertical alignment
|
|
143
|
+
|
|
144
|
+
Icons have 2 modes: inline and block. Difference between modes is `vertical-align` that is added to inline icons.
|
|
145
|
+
|
|
146
|
+
Inline icons are aligned slightly below baseline, so they look centred compared to text, like glyph fonts.
|
|
147
|
+
|
|
148
|
+
Block icons do not have alignment, like images, which aligns them to baseline by default.
|
|
149
|
+
|
|
150
|
+
Alignment option was added to make icons look like continuation of text, behaving like glyph fonts. This should make migration from glyph fonts easier.
|
|
151
|
+
|
|
152
|
+
To toggle between block and inline modes, you can use boolean `inline` property:
|
|
153
|
+
|
|
154
|
+
```vue
|
|
155
|
+
<template>
|
|
156
|
+
<div>
|
|
157
|
+
<p>
|
|
158
|
+
Block:
|
|
159
|
+
<Icon icon="line-md:image-twotone" />
|
|
160
|
+
<Icon icon="mdi:account-box-outline" />
|
|
161
|
+
</p>
|
|
162
|
+
<p>
|
|
163
|
+
Inline:
|
|
164
|
+
<Icon icon="line-md:image-twotone" :inline="true" />
|
|
165
|
+
<Icon icon="mdi:account-box-outline" :inline="true" />
|
|
166
|
+
</p>
|
|
167
|
+
</div>
|
|
168
|
+
</template>
|
|
169
|
+
|
|
170
|
+
<script>
|
|
171
|
+
import { Icon } from '@iconify/vue';
|
|
172
|
+
|
|
173
|
+
export default {
|
|
174
|
+
components: {
|
|
175
|
+
Icon,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
</script>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Visual example to show the difference between inline and block modes:
|
|
182
|
+
|
|
183
|
+

|
|
184
|
+
|
|
185
|
+
## Icon component properties
|
|
186
|
+
|
|
187
|
+
`icon` property is mandatory. It tells component what icon to render. If the property value is invalid, the component will render an empty icon. The value can be a string containing the icon name (icon must be registered before use by calling `addIcon` or `addCollection`, see instructions above) or an object containing the icon data.
|
|
188
|
+
|
|
189
|
+
The icon component has the following optional properties:
|
|
190
|
+
|
|
191
|
+
- `inline`. Changes icon behaviour to match icon fonts. See "Inline icon" section below.
|
|
192
|
+
- `width` and `height`. Icon dimensions. The default values are "1em" for both. See "Dimensions" section below.
|
|
193
|
+
- `color`. Icon colour. This is the same as setting colour in style. See "Icon colour" section below.
|
|
194
|
+
- `flip`, `horizontalFlip`, `verticalFlip`. Flip icon horizontally and/or vertically. See "Transformations" section below.
|
|
195
|
+
- `rotate`. Rotate icon by 90, 180 or 270 degrees. See "Transformations" section below.
|
|
196
|
+
- `align`, `verticalAlign`, `horizontalAlign`, `slice`. Icon alignment. See "Alignment" section below.
|
|
197
|
+
- `onLoad`. Callback function that is called when icon data has been loaded. See "onLoad" section below.
|
|
198
|
+
|
|
199
|
+
Note: in templates you can use "camelCase" properties as "kebab-case". For example, `horizontalFlip` can be used as `horizontal-flip`.
|
|
200
|
+
|
|
201
|
+
### Other properties and events
|
|
202
|
+
|
|
203
|
+
In addition to the properties mentioned above, the icon component accepts any other properties and events. All other properties and events will be passed to generated `SVG` element, so you can do stuff like assigning click event, setting the inline style, add title and so on.
|
|
204
|
+
|
|
205
|
+
### Dimensions
|
|
206
|
+
|
|
207
|
+
By default, icon height is "1em". With is dynamic, calculated using the icon's width to height ratio.
|
|
208
|
+
|
|
209
|
+
There are several ways to change icon dimensions:
|
|
210
|
+
|
|
211
|
+
- Setting `font-size` in style.
|
|
212
|
+
- Setting `width` and/or `height` property.
|
|
213
|
+
|
|
214
|
+
Values for `width` and `height` can be numbers or strings.
|
|
215
|
+
|
|
216
|
+
If you set only one dimension, another dimension will be calculated using the icon's width to height ratio. For example, if the icon size is 16 x 24, you set the height to 48, the width will be set to 32. Calculations work not only with numbers, but also with string values.
|
|
217
|
+
|
|
218
|
+
#### Dimensions as numbers
|
|
219
|
+
|
|
220
|
+
You can use numbers for `width` and `height`.
|
|
221
|
+
|
|
222
|
+
```html
|
|
223
|
+
<Icon icon="mdi-light:home" :height="24" />
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
```html
|
|
227
|
+
<Icon icon="mdi-light:home" :width="16" :height="16" />
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Note ":" before attribute - in Vue it changes the value to expression, so "20" is a number, not a string.
|
|
231
|
+
|
|
232
|
+
Number values are treated as pixels. That means in examples above, values are identical to "24px" and "16px".
|
|
233
|
+
|
|
234
|
+
#### Dimensions as strings without units
|
|
235
|
+
|
|
236
|
+
If you use strings without units, they are treated the same as numbers in an example above.
|
|
237
|
+
|
|
238
|
+
```html
|
|
239
|
+
<Icon icon="mdi-light:home" height="24" />
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
```html
|
|
243
|
+
<Icon icon="mdi-light:home" width="16" height="16" />
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Dimensions as strings with units
|
|
247
|
+
|
|
248
|
+
You can use units in width and height values:
|
|
249
|
+
|
|
250
|
+
```html
|
|
251
|
+
<Icon icon="mdi-light:home" height="2em" />
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Be careful when using `calc`, view port based units or percentages. In SVG element they might not behave the way you expect them to behave and when using such units, you should consider settings both width and height.
|
|
255
|
+
|
|
256
|
+
#### Dimensions as 'auto'
|
|
257
|
+
|
|
258
|
+
Keyword "auto" sets dimensions to the icon's `viewBox` dimensions. For example, for 24 x 24 icon using `height="auto"` sets height to 24 pixels.
|
|
259
|
+
|
|
260
|
+
```html
|
|
261
|
+
<Icon icon="mdi-light:home" height="auto" />
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Icon colour
|
|
265
|
+
|
|
266
|
+
There are two types of icons: icons that do not have a palette and icons that do have a palette.
|
|
267
|
+
|
|
268
|
+
Icons that do have a palette, such as emojis, cannot be customised. Setting colour to such icons will not change anything.
|
|
269
|
+
|
|
270
|
+
Icons that do not have a palette can be customised. By default, colour is set to "currentColor", which means the icon's colour matches text colour. To change the colour you can:
|
|
271
|
+
|
|
272
|
+
- Set `color` style or use stylesheet to target icon. If you are using the stylesheet, target `svg` element.
|
|
273
|
+
- Add `color` property.
|
|
274
|
+
|
|
275
|
+
Examples:
|
|
276
|
+
|
|
277
|
+
Using `color` property:
|
|
278
|
+
|
|
279
|
+
```html
|
|
280
|
+
<Icon icon="eva:alert-triangle-fill" color="red" />
|
|
281
|
+
<Icon icon="eva:alert-triangle-fill" color="#f00" />
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Using inline style:
|
|
285
|
+
|
|
286
|
+
```html
|
|
287
|
+
<Icon icon="eva:alert-triangle-fill" style="color: red;" />
|
|
288
|
+
<Icon icon="eva:alert-triangle-fill" :style="{color: 'red'}" />
|
|
289
|
+
<Icon icon="eva:alert-triangle-fill" :style="{color: '#f00'}" />
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Using stylesheet:
|
|
293
|
+
|
|
294
|
+
```vue
|
|
295
|
+
<template>
|
|
296
|
+
<Icon icon="eva:alert-triangle-fill" class="red-icon" />
|
|
297
|
+
</template>
|
|
298
|
+
|
|
299
|
+
<style>
|
|
300
|
+
.red-icon {
|
|
301
|
+
color: red;
|
|
302
|
+
}
|
|
303
|
+
</style>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Transformations
|
|
307
|
+
|
|
308
|
+
You can rotate and flip the icon.
|
|
309
|
+
|
|
310
|
+
This might seem redundant because icon can also be rotated and flipped using CSS transformations. So why do transformation properties exist? Because it is a different type of transformation.
|
|
311
|
+
|
|
312
|
+
- CSS transformations transform the entire icon.
|
|
313
|
+
- Icon transformations transform the contents of the icon.
|
|
314
|
+
|
|
315
|
+
If you have a square icon, this makes no difference. However, if you have an icon that has different width and height values, it makes a huge difference.
|
|
316
|
+
|
|
317
|
+
Rotating 16x24 icon by 90 degrees results in:
|
|
318
|
+
|
|
319
|
+
- CSS transformation keeps 16x24 bounding box, which might cause the icon to overlap text around it.
|
|
320
|
+
- Icon transformation changes bounding box to 24x16, rotating content inside an icon.
|
|
321
|
+
|
|
322
|
+
See [icon transformations documentation](https://iconify.design/docs/icon-components/vue/transform.html) for more details.
|
|
323
|
+
|
|
324
|
+
#### Flipping an icon
|
|
325
|
+
|
|
326
|
+
There are several properties available to flip an icon:
|
|
327
|
+
|
|
328
|
+
- `horizontal-flip` or `h-flip`: boolean property, flips icon horizontally.
|
|
329
|
+
- `vertical-flip` or `v-flip`: boolean property, flips icon vertically.
|
|
330
|
+
- `flip`: shorthand string property, can flip icon horizontally and/or vertically.
|
|
331
|
+
|
|
332
|
+
Examples:
|
|
333
|
+
|
|
334
|
+
Flip an icon horizontally:
|
|
335
|
+
|
|
336
|
+
```html
|
|
337
|
+
<Icon icon="eva:alert-triangle-fill" :h-flip="true" />
|
|
338
|
+
<Icon icon="eva:alert-triangle-fill" :horizontal-flip="true" />
|
|
339
|
+
<Icon icon="eva:alert-triangle-fill" flip="horizontal" />
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Flip an icon vertically:
|
|
343
|
+
|
|
344
|
+
```html
|
|
345
|
+
<Icon icon="eva:alert-triangle-fill" :v-flip="true" />
|
|
346
|
+
<Icon icon="eva:alert-triangle-fill" :vertical-flip="true" />
|
|
347
|
+
<Icon icon="eva:alert-triangle-fill" flip="vertical" />
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Flip an icon horizontally and vertically (the same as 180 degrees rotation):
|
|
351
|
+
|
|
352
|
+
```html
|
|
353
|
+
<Icon icon="eva:alert-triangle-fill" :h-flip="true" :v-flip="true" />
|
|
354
|
+
<Icon
|
|
355
|
+
icon="eva:alert-triangle-fill"
|
|
356
|
+
:horizontal-flip="true"
|
|
357
|
+
:vertical-flip="true"
|
|
358
|
+
/>
|
|
359
|
+
<Icon icon="eva:alert-triangle-fill" flip="horizontal,vertical" />
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Why are there multiple boolean properties for flipping an icon?
|
|
363
|
+
|
|
364
|
+
In components for other frameworks, properties for flipping an icon are `hFlip` and `vFlip`. Vue has special treatment for properties that start with v-, so `vFlip` (same applies to `vAlign` attribute) attribute is not available without using tricky syntax.
|
|
365
|
+
|
|
366
|
+
Because of that, Vue component uses longer property names: `verticalFlip` instead of `vFlip` and `horizontalFlip` instead of `hFlip` for consistency.
|
|
367
|
+
|
|
368
|
+
#### Rotating an icon
|
|
369
|
+
|
|
370
|
+
An icon can be rotated by 90, 180 and 270 degrees. Only contents of the icon are rotated.
|
|
371
|
+
|
|
372
|
+
To rotate an icon, use `rotate` property. Value can be a string (degrees or percentages) or a number.
|
|
373
|
+
|
|
374
|
+
Number values are 1 for 90 degrees, 2 for 180 degrees, 3 for 270 degrees.
|
|
375
|
+
|
|
376
|
+
Examples of 90 degrees rotation:
|
|
377
|
+
|
|
378
|
+
```html
|
|
379
|
+
<Icon icon="eva:alert-triangle-fill" :rotate="1" />
|
|
380
|
+
<Icon icon="eva:alert-triangle-fill" rotate="90deg" />
|
|
381
|
+
<Icon icon="eva:alert-triangle-fill" rotate="25%" />
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### onLoad
|
|
385
|
+
|
|
386
|
+
`onLoad` property is an optional callback function. It is called when icon data has been loaded.
|
|
387
|
+
|
|
388
|
+
It is not an event, such as `onClick` event for links, it is a simple callback function.
|
|
389
|
+
|
|
390
|
+
When `onLoad` is called:
|
|
391
|
+
|
|
392
|
+
- If value of icon property is an object, `onLoad` is not called.
|
|
393
|
+
- If value of icon property is a string and icon data is available, `onLoad` is called on first render.
|
|
394
|
+
- If value of icon property is a string and icon data is not available, `onLoad` is called on first re-render after icon data is retrieved from API.
|
|
395
|
+
|
|
396
|
+
What is the purpose of `onLoad`? To let you know when Icon component renders an icon and when it does not render anything. This allows you to do things like adding class name for parent element, such as "container--with-icon" that modify layout if icon is being displayed.
|
|
397
|
+
|
|
398
|
+
## Full documentation
|
|
399
|
+
|
|
400
|
+
For extended documentation visit [Iconify for Vue documentation](https://iconify.design/docs/icon-components/vue/).
|
|
401
|
+
|
|
402
|
+
## License
|
|
403
|
+
|
|
404
|
+
Vue component is released with MIT license.
|
|
405
|
+
|
|
406
|
+
© 2020-PRESENT Vjacheslav Trushkin
|
|
407
|
+
|
|
408
|
+
See [Iconify icon sets page](https://icon-sets.iconify.design/) for list of collections and their licenses.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# @iconify/vue/offline
|
|
2
|
+
|
|
3
|
+
This sub-directory contains `package.json` with entry points for importing `@iconify/vue/offline`.
|
|
4
|
+
|
|
5
|
+
There is a duplicate entry in `exports` section of `package.json` in the parent directory, but at moment of coding this, TypeScript does not support conditional exports properly, so this directory is used as a duplicate to make everything work with TypeScript.
|