export const metadata = { title: "Data Binding" }
# Data Binding
Connect UI components to your application data using JSON Pointer paths.
## JSON Pointer Paths
json-render uses JSON Pointer (RFC 6901) for data paths:
```json
// Given this data:
{
"user": {
"name": "Alice",
"email": "alice@example.com"
},
"metrics": {
"revenue": 125000,
"growth": 0.15
}
}
// These paths access:
"/user/name" -> "Alice"
"/metrics/revenue" -> 125000
"/metrics/growth" -> 0.15
```
## StateProvider
Wrap your app with StateProvider to enable data binding:
```tsx
import { StateProvider } from '@json-render/react';
function App() {
const initialState = {
user: { name: 'Alice' },
form: { email: '', message: '' },
};
return (
{JSON.stringify(data, null, 2)};
}
```
## In JSON UI Trees
AI can reference data paths in component props:
```json
{
"type": "Metric",
"props": {
"label": "Total Revenue",
"valuePath": "/metrics/revenue",
"format": "currency"
}
}
```
## Next
Learn about [actions](/docs/actions) for user interactions.