law-render
v0.8.0
Published
**Law Render** is a TypeScript React component for rendering legal documents, statutes, or regulations in a structured and visually appealing way. It provides a flexible tree-based rendering system for legal text, supporting a wide range of legal document
Readme
Law Render
Law Render is a TypeScript React component for rendering legal documents, statutes, or regulations in a structured and visually appealing way. It provides a flexible tree-based rendering system for legal text, supporting a wide range of legal document structures (articles, sections, points, tables, footnotes, etc.).
Features
- Hierarchical Rendering: Supports complex legal document structures (articles, sections, points, tables, footnotes, etc.).
- Customizable Output: Uses semantic HTML and utility classes for easy styling and integration.
- TypeScript Support: Fully typed props and data structures for safety and developer experience.
- Extensible: Easily add support for new node types or customize rendering.
Installation
npm install law-render
# or
yarn add law-renderUsage
import React from 'react';
import { LawRender, LawTree } from 'law-render';
const lawTree: LawTree = [
{
levelName: "article",
identifier: "Article 1",
content: "This is the content of Article 1.",
children: [
{
levelName: "section",
identifier: "Section 1.1",
content: "Section content here."
}
]
}
];
export default function App() {
return <LawRender treeToRender={lawTree} />;
}Props
| Prop | Type | Description |
|----------------|-----------|------------------------------------------|
| treeToRender | LawTree | The tree structure representing the law. |
License
MIT
