Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

JSON Validator File Upload Block for Solid

A JSON payload checker: paste text and see Valid or the line and column of the first error with the line shown, the key count, depth and size, a flattened tree of the parsed result, plus Prettify and Copy.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Find the one bad character in a payload before it ships, with this JSON validator panel for Solid with Ark UI. It is Bracemark, API payload linting for a backend team. A monospaced Textarea starts with a payload that has one trailing comma; beside it, a result says "Invalid at line 4, column 43", shows that line with a caret under the column, and turns to a key count, a depth, a size in bytes and a flattened tree of the parsed result once the text is valid. A strict scanner at module scope, the same in every browser, finds the error. The one Shine Button prettifies valid text with two spaces and a Copy Button copies the payload. A File Upload strip lists a dropped .json file by name and size and says to paste its text. The panel is ruled by Guides, with a CSS entrance only. For API tooling, config editors and any form that takes JSON.

FAQ

Why not just call JSON.parse?

Browsers word its errors differently and some give no position at all. The scanner reads the text itself against the JSON grammar, so the message, line and column are the same everywhere. It reports the first problem only, such as a trailing comma, a single-quoted key or text after the value.

What is typed and what is worked out?

Only the starting payload is typed. The result, key count, depth, size and tree are all worked out from the text each time it changes, and the status line repeats the headline for screen readers.

What does Prettify do with invalid text?

Nothing to the text: the button stays pressable so the reason can be heard, and the status line says it cannot prettify and where the error is. Once the text is valid it is rewritten with two-space indents.

What stays local in this demo?

All of it. The text lives in the page, a dropped file is listed by name and size and never opened (paste its text instead), and nothing is uploaded or saved.

How do I use it in my product?

Keep the scanner and replace the payload with your own text. To accept files, read the dropped file's text in the accept handler and pass it to the same state, and add your schema checks after the scanner passes.

Is the tree collapsible?

It is a flat list in this version, indented by depth and cut at forty rows so the panel keeps its height. Swap in the JSON Tree View component if you want branches that open and close.