You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,88 +12,11 @@ import PlaygroundButton from '@site/src/components/PlaygroundButton';
12
12
13
13
# React SDK Components
14
14
15
-
## 🎨 Theming
16
-
17
-
### How Theming Works
18
-
19
-
All UI components in `@onflow/react-sdk` are styled using [Tailwind CSS](https://tailwindcss.com/) utility classes. The kit supports both light and dark themes out of the box, using Tailwind's `dark:` variant for dark mode styling.
20
-
21
-
You can customize the look and feel of the kit by providing a custom theme to the `FlowProvider` via the `theme` prop. This allows you to override default colors and styles to better match your app's branding.
Dark mode is **fully controlled by the parent app** using the `darkMode` prop on `FlowProvider`. The kit does not manage dark mode state internally—this gives you full control and ensures the kit always matches your app's theme.
50
-
51
-
-`darkMode={false}` (default): Forces all kit components to use light mode styles.
52
-
-`darkMode={true}`: Forces all kit components to use dark mode styles.
53
-
- You can dynamically change the `darkMode` prop to switch themes at runtime.
54
-
55
-
**Example:**
56
-
57
-
```tsx
58
-
function App() {
59
-
// Parent app manages dark mode state
60
-
const [isDark, setIsDark] =useState(false)
61
-
62
-
return (
63
-
<FlowProviderconfig={...}darkMode={isDark}>
64
-
<MyFlowComponents />
65
-
</FlowProvider>
66
-
)
67
-
}
68
-
```
69
-
70
-
**Accessing Dark Mode State in Components:**
71
-
72
-
You can use the `useDarkMode` hook to check the current mode inside your components:
73
-
74
-
```tsx
75
-
import { useDarkMode } from"@onflow/react-sdk"
76
-
77
-
function MyComponent() {
78
-
// useDarkMode only returns the current state, no setter
- The kit does **not** automatically follow system preferences or save user choices. You are responsible for managing and passing the correct `darkMode` value.
87
-
- All kit components will automatically apply the correct Tailwind `dark:` classes based on the `darkMode` prop.
88
-
- For best results, ensure your app's global theme and the kit's `darkMode` prop are always in sync.
89
-
90
-
---
91
-
92
15
## Components
93
16
94
17
### `Connect`
95
18
96
-
A drop-in wallet connection component with UI for copy address, logout, and balance display.
19
+
A drop-in wallet connection component with UI for copy address, logout, and balance display. Displays user scheduled transactions within its profile modal with support for multiple tokens.
@@ -103,9 +26,17 @@ A drop-in wallet connection component with UI for copy address, logout, and bala
103
26
-`onConnect?: () => void` – Callback triggered after successful authentication
104
27
-`onDisconnect?: () => void` – Callback triggered after logout
105
28
-`balanceType?: "cadence" | "evm" | "combined"` – Specifies which balance to display (default: `"cadence"`). Options:
106
-
-`"cadence"`: Shows the FLOW token balance from the Cadence side
107
-
-`"evm"`: Shows the FLOW token balance from the Flow EVM side
108
-
-`"combined"`: Shows the total combined FLOW token balance from both sides
29
+
-`"cadence"`: Shows the token balance from the Cadence side
30
+
-`"evm"`: Shows the token balance from the Flow EVM side
31
+
-`"combined"`: Shows the total combined token balance from both sides
32
+
-`balanceTokens?: TokenConfig[]` – Optional array of token configurations to display in the balance selector. Each `TokenConfig` requires:
33
+
-`symbol: string` – Token symbol (e.g. "FLOW", "USDC")
34
+
-`name: string` – Full token name
35
+
- Either `vaultIdentifier: string` (for Cadence tokens) or `erc20Address: string` (for EVM tokens)
36
+
-`modalConfig?: ConnectModalConfig` – Optional configuration for the profile modal:
37
+
-`scheduledTransactions.show?: boolean` – Whether to show the scheduled transactions tab (default: `false`)
38
+
-`scheduledTransactions.filterHandlerTypes?: string[]` – Optional array of handler type identifiers to filter displayed transactions
39
+
-`modalEnabled?: boolean` – Whether to show the profile modal on click when connected (default: `true`). When `false`, clicking the button when connected will disconnect instead
109
40
110
41
```tsx
111
42
import { Connect } from"@onflow/react-sdk"
@@ -116,7 +47,7 @@ import { Connect } from "@onflow/react-sdk"
116
47
/>
117
48
```
118
49
119
-
### Live Demo
50
+
####Live Demo
120
51
121
52
<FlowProviderDemo>
122
53
<Connect
@@ -127,6 +58,40 @@ import { Connect } from "@onflow/react-sdk"
127
58
128
59
---
129
60
61
+
### `Profile`
62
+
63
+
A standalone component for displaying wallet information including account address, balance and optional scheduled transactions.
Button component for executing Flow transactions with built-in loading states and global transaction management.
@@ -166,7 +131,7 @@ const myTransaction = {
166
131
/>
167
132
```
168
133
169
-
### Live Demo
134
+
####Live Demo
170
135
171
136
<FlowProviderDemo>
172
137
<TransactionButton
@@ -213,7 +178,7 @@ import { TransactionDialog } from "@onflow/react-sdk"
213
178
/>
214
179
```
215
180
216
-
### Live Demo
181
+
####Live Demo
217
182
218
183
<TransactionDialogDemo />
219
184
@@ -236,11 +201,165 @@ import { TransactionLink } from "@onflow/react-sdk"
236
201
<TransactionLinktxId="your-tx-id" />
237
202
```
238
203
239
-
### Live Demo
204
+
####Live Demo
240
205
241
206
<FlowProviderDemo>
242
207
<TransactionLink
243
208
txId="0x1234567890abcdef"
244
209
variant="primary"
245
210
/>
246
-
</FlowProviderDemo>
211
+
</FlowProviderDemo>
212
+
213
+
---
214
+
215
+
### `NftCard`
216
+
217
+
A component for rendering a NFT with image, name, description, collection details, traits and external links. Features include loading states, error handling, dark mode support and optional custom actions.
A component for displaying scheduled transactions for a Flow account. Shows transaction metadata including thumbnails, descriptions, priority, scheduled time, execution effort, fees and provides an optional transaction cancellation functionality.
-`address: string` – The Flow account address to fetch scheduled transactions for
271
+
-`filterHandlerTypes?: string[]` – Optional array of handler type identifiers to filter which transactions are displayed. Only transactions with matching `handlerTypeIdentifier` will be shown
272
+
-`cancelEnabled?: boolean` – Whether to show the cancel button for transactions (default: `true`)
All UI components in `@onflow/react-sdk` are styled using [Tailwind CSS](https://tailwindcss.com/) utility classes. The kit supports both light and dark themes out of the box, using Tailwind's `dark:` variant for dark mode styling.
297
+
298
+
You can customize the look and feel of the kit by providing a custom theme to the `FlowProvider` via the `theme` prop. This allows you to override default colors and styles to better match your app's branding.
Dark mode is **fully controlled by the parent app** using the `darkMode` prop on `FlowProvider`. The kit does not manage dark mode state internally—this gives you full control and ensures the kit always matches your app's theme.
327
+
328
+
-`darkMode={false}` (default): Forces all kit components to use light mode styles.
329
+
-`darkMode={true}`: Forces all kit components to use dark mode styles.
330
+
- You can dynamically change the `darkMode` prop to switch themes at runtime.
331
+
332
+
**Example:**
333
+
334
+
```tsx
335
+
function App() {
336
+
// Parent app manages dark mode state
337
+
const [isDark, setIsDark] =useState(false)
338
+
339
+
return (
340
+
<FlowProviderconfig={...}darkMode={isDark}>
341
+
<MyFlowComponents />
342
+
</FlowProvider>
343
+
)
344
+
}
345
+
```
346
+
347
+
**Accessing Dark Mode State in Components:**
348
+
349
+
You can use the `useDarkMode` hook to check the current mode inside your components:
350
+
351
+
```tsx
352
+
import { useDarkMode } from"@onflow/react-sdk"
353
+
354
+
function MyComponent() {
355
+
// useDarkMode only returns the current state, no setter
- The kit does **not** automatically follow system preferences or save user choices. You are responsible for managing and passing the correct `darkMode` value.
364
+
- All kit components will automatically apply the correct Tailwind `dark:` classes based on the `darkMode` prop.
365
+
- For best results, ensure your app's global theme and the kit's `darkMode` prop are always in sync.
**The easiest way to build React apps on Flow.** A lightweight, TypeScript-first library that makes Flow blockchain interactions feel native to React development.
0 commit comments