A minimal starter showcasing Trails SDK flows in React: Fund, Pay, Swap, and Earn. It uses modern EVM tooling (Viem + Wagmi + RainbowKit), TanStack Query, Tailwind CSS, and radix components.
The onchain transaction rails for every token from every chain with every wallet with one, aggregated balance. Trails automatically detects and orchestrates the necessary steps in order to execute any cross-chain transaction with any token by swapping, bridging, and calling any arbitrary function. Integrate in seconds with only a few lines of code.
git clone https://github.com/0xsequence-demos/trails-starter.git trails-starter && cd trails-starterpnpm i
# or: npm i | yarnCopy the .env.example to .env file in the project root:
# Optional walletconnect ID if you'd like walletconnect support, retrieved from https://cloud.walletconnect.com/.
VITE_WALLETCONNECT_PROJECT_ID=pnpm dev
# or: npm run dev | yarn devOpen http://localhost:5173.
Each widget uses the same underlying TrailsWidget and differs by mode and a few props. See components/trails/*.tsx for concrete usage for each and UX flows.
- Styling: Each widget supports
customCssvariables (https://docs.trails.build/sdk/theming). Common tokens:--trails-border-radius-button--trails-primary,--trails-primary-hover--trails-text-inverse--trails-focus-ring
- For advanced usage and prop reference, see the Trails docs (
https://docs.trails.build) - AI enabled wtih a
.cursorrulesfile and MCP server for Cursor or Claude available here.
