Party

Last updated on

One party of a declared role, with the organization, address, and contact fields beside it, as a block or inline, through the shared formatter.

Party prints one party of an artifact-declared role as one kept-together block: its name from the party record, then the organization, address, and contact lines from the fields you name, each through the same shared formatter a Field reads through. A line with no path, or whose field is blank, is left out, so nothing prints empty.

Preview

Rendering live preview requires JavaScript.

Installation

npx shadcn@4 add @paradoc/party

Or, with the Paradoc CLI, which writes the namespace into components.json for you:

npx paradoc-cli add party

Installs to components/paradoc/party.tsx and brings along keep-together.

Usage

import { Party } from "@/components/paradoc/party";<Party role="buyer" organization="buyerOrganization" address="buyerAddress" contact="buyerPhone" />
PropTypeDefaultDescription
rolestring—Party role declared by the artifact, such as "buyer".
index?number00-based index, for a role admitting several parties.
organization?string—Path of the field naming the organization the party acts for, such as "buyerOrganization".
address?string—Path of the party's address field, such as "buyerAddress", or "tenants.1.address" for a list item.
contact?string | readonly string[]—Path of the party's contact field, or several (a phone and an email) printed on one line.
variant?"block" | "inline""block""block" stacks the name, organization, address, and contact each on their own line; "inline" joins them into one run for a sentence.
label?string | false—Overrides the role heading: a string replaces it, false hides it, omitted uses the artifact's own label.
keepId?string"party:<role>" or "party:<role>:<index>" past the firstStable keep id.
className?string—Classes for the party's wrapping element.

Composition

Party needs the same Document context every other component here does: role names a role the artifact declares, and index selects which one for a role a document may fill more than once. Party is a Keep Together, so it is never split across a page break, and it carries data-party-role and data-party-index the way a Field carries data-field-path.

A party record carries only name-shaped person or organization members. Where a party is, how to reach it, and whom it acts for are fields the artifact declares beside the role, each with its own label, requiredness, and layer binding. organization, address, and contact name those fields by path; contact takes one path or several (a phone and an email), printed on one line. For a role filled more than once, bind each index to its own list item, such as address="tenants.1.address".

<Party role="buyer" organization="buyerOrganization" address="buyerAddress" contact={["buyerPhone", "buyerEmail"]} />

role names an undeclared role, index a party past how many the role was actually filled with, and a path a field the artifact does not declare. A finished render fails by name in each case, the same way an unknown Field path does. That includes an optional role (min: 0) a document has not filled at all, where index 0 is already past the parties it carries. A partial document prints its configured placeholder for the missing party, while check mode reports the missing path.

Every size in the block — the role heading and every line beneath it — follows the document's typography token.

Variants

Inline

variant="inline" joins the same values into one run, for a sentence, instead of stacking them as a block.

Rendering live preview requires JavaScript.

Multiple parties

A role a document may fill more than once — witness here admits two — selects which party this block prints with index.

Rendering live preview requires JavaScript.

On this page