Skip to main content

View Organization Block

ViewOrganization is a key-value view block built on MUI with a bordered header (title and optional action button), optional subheader.

Installationโ€‹

npm install @nodeblocks/frontend-view-organization-block

What You Needโ€‹

ItemWhy it matters
labels.headerTitleOrganization name in the header
dataCompany fields as a Record<string, ReactNode> (row keys become labels) or ReactNode[] for value-only rows
labels.subheaderTitle (optional)Secondary line under the header (for example founding date or tagline)
labels.headerActionButton + headerAction (optional)Outlined header button label and click handler
layout (optional)one-column stacks key/value rows; two-column shows them side by side (default)
Organization data lives in your app

ViewOrganization does not own organization state โ€” pass labels, data, and optional headerAction from your page. Object data keys become row labels; values can be strings or React nodes (multi-line copy, links, layouts). Set labels.headerActionButton and headerAction to show the header action button with a handler.

Code Examplesโ€‹

Live Editor
function Example() {
  const labels = {
    headerTitle: 'Co-Lift Inc.',
  };

  const data = {
    Industry: 'Services',
    Website: 'https://www.co-lift.com/',
    Overview:
      'Co-Lift focuses on essential perspectivesโ€”turning business assets into product ideas, from strategy through development.',
    'Business focus':
      'End-to-end product development with full-stack engineering to solve customer challenges.',
    Founded: 'September 11, 2017',
    Leadership: 'Kanta Kinoshita, CEO ยท Keigo Sadajima, CEO',
  };

  return <ViewOrganization labels={labels} data={data} />;
}
Result
Loading...

Important Propsโ€‹

Core Propsโ€‹

PropTypeRequiredDefaultDescription
dataRecord<string, ReactNode> | ReactNode[]NoundefinedRow content: object keys become field labels; arrays render value-only rows
labels{ headerTitle?: string; headerActionButton?: string; subheaderTitle?: string }NoundefinedHeader title, optional action button label, and subheader copy

Content Propsโ€‹

PropTypeRequiredDefaultDescription
labels.headerTitlestringNoundefinedMain heading in ViewOrganization.Header
labels.subheaderTitlestringNoundefinedSecondary line under the header (ViewOrganization.Subheader)
labels.headerActionButtonstringNoundefinedLabel for the outlined header button; shown when labels.headerActionButton or headerAction is set (or passed on ViewOrganization.HeaderActionButton)
headerAction() => voidNoundefinedInvoked when the default header action button is clicked (after any onClick on the button)
layout'one-column' | 'two-column'No'two-column'Row layout: stacked key/value vs side-by-side columns

Layout and Composition Propsโ€‹

PropTypeRequiredDefaultDescription
childrenBlocksOverride | ReactNodeNoundefinedCompound JSX children or function override returning blocks and blockOrder
classNamestringNoundefinedClass name on the root stack (nbb-view-organization)
sxSxPropsNoundefinedMUI system styles for the root stack (default render includes margin: 'auto')

ViewOrganization inherits StackProps (except children). Default defaultBlockOrder: header, subheader, itemList, item, itemKey, itemValue.

Sub-component propsโ€‹

Sub-components read from context and accept the same content keys as props to override locally.

Sub-componentMain PropsInheritsBuilt on
ViewOrganization.Headerlabels (headerTitle, headerActionButton), headerAction, children, className, sxStackPropsStack + Typography + optional ViewOrganization.HeaderActionButton
ViewOrganization.HeaderActionButtonlabels (headerActionButton), headerAction, children, className, onClickButtonPropsButton (variant="outlined", size="medium")
ViewOrganization.Subheaderlabels (subheaderTitle, headerTitle, headerActionButton), children, className, sxStackPropsStack + Typography
ViewOrganization.ItemListdata, children, className, sxListPropsList (component="dl") + ViewOrganization.Item rows
ViewOrganization.Itemlayout, children, className, sxListItemPropsListItem
ViewOrganization.Item.Keylayout, children, className, sxTypographyPropsTypography (component="dt", variant="subtitle1")
ViewOrganization.Item.Valuelayout, children, className, sxTypographyPropsTypography (component="dd", variant="body2")

Default UI Blocksโ€‹

BlockBuilt onNotes
ViewOrganization (root)StackColumn layout with spacing={3}, margin: 'auto' (nbb-view-organization)
header (ViewOrganization.Header)StackRenders when labels.headerTitle, labels.headerActionButton, or custom children is set; default styling adds bottom border, py: 3, mb: 3; includes ViewOrganization.HeaderActionButton when headerAction or labels.headerActionButton is set
subheader (ViewOrganization.Subheader)StackRenders when labels.subheaderTitle or custom children is set
itemList (ViewOrganization.ItemList)ListMaps data object entries or array values to key/value rows

Default root render order: header โ†’ subheader โ†’ itemList.

TypeScriptโ€‹

import * as React from 'react';
import { ViewOrganization } from '@nodeblocks/frontend-view-organization-block';
import type { ReactNode } from 'react';

type OrganizationLabels = {
headerTitle?: string;
headerActionButton?: string;
subheaderTitle?: string;
};

type OrganizationData = Record<string, ReactNode>;

export function OrganizationDetailView() {
const labels: OrganizationLabels = {
headerTitle: 'Co-Lift Inc.',
subheaderTitle: 'Founded September 11, 2017',
headerActionButton: 'Edit organization',
};

const data: OrganizationData = {
Headquarters: 'Shibuya-ku, Tokyo',
Phone: '03-6821-0661',
Industry: 'Services',
Website: 'https://www.co-lift.com/',
};

return (
<ViewOrganization
labels={labels}
data={data}
headerAction={() => {
/* navigate or open edit dialog */
}}
/>
);
}