Custom trace views transform complex traces into interfaces anyone on your team can use. Describe what you want in natural language and Loop generates an interactive React component you can customize or embed anywhere.
Build custom annotation interfaces for large-scale human review tasks, surfacing only relevant information for annotators and subject matter experts.
Simplifying traces for non-engineers
Replace JSON with intuitive UI components like carousels, playlists, or structured summaries to make traces accessible to PMs, legal reviewers, and domain experts.
Industry-specific visualizations
Create views that mirror your product experience:
Playlist-style views for music applications
Interactive source-and-answer layouts
Custom dashboards for internal evaluations
Multi-turn conversation analysis
Aggregate and display data across conversation turns to analyze dialogue flow and long-running interactions.
Select a trace in your logs, experiments, or during human review.
Select Views.
Describe how you want to view your trace data.
After Loop generates your view, refine the view by describing additional changes or edit the React component code directly.Example prompts:
“Create a view that renders a list of all tools available in this trace and their outputs”
“Build an interface to review each trace one by one with easy switching between traces”
“Create a conversation-style view that highlights user messages and assistant responses”
“Render the video url from the trace’s metadata field and show simple thumbs up/down buttons”
Self-hosted deployments: If you restrict outbound access, allowlist https://www.braintrustsandbox.dev to enable custom views. This domain hosts the sandboxed iframe that securely renders custom view code.
By default, a custom trace view is only visible and editable by the user who created it. To share your view with all users in the project:
Select Save in the view editor.
Choose Save as new view version.
Select Update to make it available project-wide.
All team members can then use the shared view when reviewing traces. Custom views integrate with Braintrust workflows — use them during human review, write annotations that flow into datasets, and combine with Loop for analysis.
Custom trace views are React components that run inside Braintrust. You can edit the component code directly to customize behavior beyond what Loop generates.To edit the React code:
Go to the custom trace view.
Select in the lower left of the view.
Select Edit.
Your React component receives the following props:
Prop
Type
Description
trace
object
Contains all spans and methods for the trace. Attachment URLs in span data are automatically signed for rendering.
span
object
The currently selected span with full data
update
function
Update span metadata: update('field', value)
selectSpan
function
Navigate to a different span: selectSpan(spanId)
The trace object includes:
rootSpanId, selectedSpanId - Current span context
spanOrder - All span IDs in execution order
spans - Map of span_id → span (IDs/relationships only)
Custom views support interactive elements that write data back to traces. Add buttons, inputs, or custom controls to collect:
Human review scores
Thumbs up/down feedback
Custom metadata fields
Annotation notes
Use the update function to write metadata back to the trace. This enables annotation workflows where review and data collection happen in the same interface.
By default, only the selected span has full data (input, output, expected, metadata). To access data from other spans, use fetchSpanFields:
Report incorrect code
Copy
Ask AI
// Fetch all fields for one spanconst data = await trace.fetchSpanFields(spanId);// Fetch specific fields for multiple spansconst data = await trace.fetchSpanFields(trace.spanOrder, ['input', 'output']);
Attachments (images, videos, audio, and other binary data) logged in your traces can be displayed directly in custom views. When span data is fetched, Braintrust automatically converts attachment references to inline_attachment objects with pre-signed URLs ready for rendering.Attachments in span data are automatically transformed into objects with this structure:
Report incorrect code
Copy
Ask AI
{ type: "inline_attachment", src: "https://signed-url...", // Pre-signed URL ready to use content_type: "image/jpeg", // MIME type filename: "example.jpg" // Optional filename}
The type field identifies the object as an attachment, src contains a pre-signed URL that works directly in image, video, or audio tags, and content_type indicates the media type.For example, the following code creates an input/output verification view that automatically detects and renders attachments alongside regular data: