{"id":20252380,"url":"https://github.com/bewinxed/wallet-adapter-svelte-ui","last_synced_at":"2025-04-10T23:16:58.282Z","repository":{"id":254063022,"uuid":"845371627","full_name":"Bewinxed/wallet-adapter-svelte-ui","owner":"Bewinxed","description":"Solana UI Components for Svelte 5","archived":false,"fork":false,"pushed_at":"2024-10-08T17:59:35.000Z","size":666,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T23:16:52.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bewinxed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T05:54:24.000Z","updated_at":"2025-02-18T20:25:03.000Z","dependencies_parsed_at":"2024-12-18T19:35:47.347Z","dependency_job_id":"02a26966-f1a6-44e3-8584-5011c0d3602b","html_url":"https://github.com/Bewinxed/wallet-adapter-svelte-ui","commit_stats":null,"previous_names":["bewinxed/wallet-adapter-svelte-ui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bewinxed%2Fwallet-adapter-svelte-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bewinxed%2Fwallet-adapter-svelte-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bewinxed%2Fwallet-adapter-svelte-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bewinxed%2Fwallet-adapter-svelte-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bewinxed","download_url":"https://codeload.github.com/Bewinxed/wallet-adapter-svelte-ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312132,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T10:16:27.931Z","updated_at":"2025-04-10T23:16:58.265Z","avatar_url":"https://github.com/Bewinxed.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@bewinxed/wallet-adapter-svelte-ui`\n\nThis is a direct port of [anza-xyz/wallet-adapter](https://github.com/anza-xyz/wallet-adapter) to Svelte 5 (Will not support older versions).\n\nWith (IMO) better UI, Accessibility, and Performance.\n\n# Requirements\n**Note:** Svelte 5 \u0026 TailwindCSS are required!\n\n## Installation\nMake sure you install the [Wallet Adapter](https://www.npmjs.com/package/@bewinxed/wallet-adapter-svelte) first.\n```\nnpm install @bewinxed/wallet-adapter-svelte-ui\npnpm add @bewinxed/wallet-adapter-svelte-ui\nbun add @bewinxed/wallet-adapter-svelte-ui\n```\n\n## Setup\nAdd the connection/wallet/modal providers into your main layout.\n```svelte\n\u003cscript lang=\"ts\"\u003e\n\timport { ConnectionProvider, WalletProvider } from '@bewinxed/wallet-adapter-svelte';\n    import { WalletModalProvider, WalletMultiButton } from '@bewinxed/wallet-adapter-svelte-ui';\n\timport { Connection, PublicKey } from '@solana/web3.js';\n\timport { onMount } from 'svelte';\n\u003c/script\u003e\n\n\u003cConnectionProvider config={{endpoint: 'https://api.mainnet-beta.solana.com'}}\u003e\n\t\u003cWalletProvider wallets={[]}\u003e\n\t\t\u003cWalletModalProvider\u003e\n\t\t\t\u003cWalletMultiButton /\u003e\n\t\t\u003c/WalletModalProvider\u003e\n\t\u003c/WalletProvider\u003e\n\u003c/ConnectionProvider\u003e\n```\n\n## Context\nThe connection and wallet data are available in one rune, useSolana().\n```svelte\n\u003cscript lang=\"ts\"\u003e\n\timport { useSolana } from '@bewinxed/wallet-adapter-svelte';\n\n    const solana = useSolana();\n    const {connection, context} = $derived(solana);\n\u003c/script\u003e\n\n{#if context.wallet}\n\t{context.wallet.publicKey}\n{/if}\n```\n\n## Events\nMultiple helpful event types have been exposed on the WalletProvider and WalletModalProvider, as well as the WalletMultiButton.\n# WalletProvider\n- onconnect\n- ondisconnect\n- onerror\n# WalletModalProvider\n- onopen\n- onclose\n# WalletMultiButton\n- onconnect\n- ondisconnect\n- onselectwallet\n- ...all HTML button props/handlers.\n\n# Changes/Fixes vs Wallet Adapter \u0026 Svelte-On-Solana\n- Wallets are auto detected now, no need to add them separately.\n- Updates in line with the React version (With much cleanup because react).\n- No svelte stores needed, all done with runes now.\n- Better UI (Styled with tailwind, CSS later if asked.)\n- Accessibility (Keyboard navigation, focus management, etc.)\n\n## Customization\n- You can pass classes/styles to the buttons now, making it easier to customize the button for your app vs fiddling with global CSS styles.\n```svelte\n\u003cWalletMultiButton class=\"bg-red-500 text-white rounded-full p-2\" /\u003e\n```\n**Note:** The buttons have helpful attributes for styling, such as `square` and `flat`.\n| Attribute | Description |\n| --- | --- |\n| `square` | Removes border radius.\n| `flat` | Removes shadows.\n| `headless` | Removes all styling from the button, then you can pass your own styles.\n\n## CSS Variables (Will work next version)\nYou can use the following CSS variables to customize the WalletAdapter Svelte UI.\n| Variable | Description |\n| --- | --- |\n| `--solana-primary` | Primary color for the WalletAdapter Svelte UI.\n| `--solana-primary-light` | Lighter primary color for the WalletAdapter Svelte UI.\n| `--solana-secondary` | Secondary color for the WalletAdapter Svelte UI.\n| `--solana-secondary-light` | Lighter secondary color for the WalletAdapter Svelte UI.\n| `--solana-accent` | Accent color for the WalletAdapter Svelte UI.\n| `--solana-accent-light` | Lighter accent color for the WalletAdapter Svelte UI.\n| `--solana-backdrop` | Backdrop color for the WalletAdapter Svelte UI.\n\n## Comparison\nBetter Modal UI, Native modal on mobile.\n\nOld:\n![before](https://github.com/bewinxed/wallet-adapter-svelte-ui/blob/main/static/image-1.png?raw=true)\n\nNew:\n![after](https://github.com/bewinxed/wallet-adapter-svelte-ui/blob/main/static/image.png?raw=true)\n\n## Next up.\n- Add helpful utilities to generate messages/transactions/send transactions.\n- UI polishes.\n- Make sure Anchor works.\n- Migrate to @solana/web3.js 2.* experimental.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewinxed%2Fwallet-adapter-svelte-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbewinxed%2Fwallet-adapter-svelte-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewinxed%2Fwallet-adapter-svelte-ui/lists"}