An awsm json viwer featuring JSON extraction, tree view, raw view, search capabilities, and a modern UI using shadcn/ui components.
- JSON Extraction: Automatically extracts valid JSON from text that may contain other content.
- Tree View: Interactive collapsible tree representation of JSON data.
- Raw View: Displays the JSON in its raw, formatted string form.
- Search Functionality: Search through JSON keys and values with highlighting.
- Copy to Clipboard: Easily copy the parsed JSON.
- Theme Support: Light and dark mode toggle.
- Responsive Design: Works on desktop and mobile devices.
- Security: Includes Content Security Policy and other security headers.
- Node.js (version 18 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/your-username/json_viewer.git cd json_viewer -
Install dependencies:
yarn install
-
Run the development server:
yarn dev
-
Open http://localhost:3000 in your browser.
npm run build
npm start # start production serverJsonMain: Main component managing state and layout.JsonViewer: Handles view modes (tree/raw) and rendering.JsonTree: Recursive component for tree view rendering.JsonInput: Textarea for JSON input with error handling.Footer: Footer with controls for view mode, search, and theme.
- Paste your JSON or text containing JSON into the left panel.
- The app will automatically parse and display the JSON in the right panel.
- Switch between Tree View and Raw View using the tabs.
- Use the search bar to highlight matching keys/values.
- Click "Copy" to copy the formatted JSON to clipboard.
- Toggle between light and dark themes.
- Next.js: React framework for server-side rendering and static site generation.
- React: UI library for building components.
- TypeScript: Typed JavaScript for better development experience.
- Tailwind CSS: Utility-first CSS framework.
- shadcn/ui: Modern UI components built on Radix UI.
- Lucide React: Icon library.
- react-resizable-panels: For resizable panels.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature. - Commit your changes:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/your-feature. - Open a pull request.