@plasius/sharedcomponents
v1.0.2
Published
Base React UI components for shared navigation, menus, profile shells, and legal/contact surfaces.
Readme
@plasius/sharedcomponents
Base React UI package for cross-application navigation and shared legal/contact UI.
Scope
This package is intentionally a base component layer:
- No auth coupling
- No profile store coupling
- No environment/service coupling
- No router coupling in core components
If a product needs auth/profile behavior, wire it via callbacks/props from the host app.
Included Components
Header: configurable nav with optional profile slot and mobile context menuFooter: configurable legal/footer links with mobile context menuContactDetails: reusable legal contact block with configurable detailsContextMenu: generic context menu surfaceUserProfile: optional generic avatar/menu shell driven by callbacks
Install
npm install @plasius/sharedcomponentsUsage
import { Footer, Header, UserProfile } from "@plasius/sharedcomponents";
import { PlasiusLTDLogo } from "@plasius/sharedassets";
const navHeaderItems = [
{ name: "Hexagons", url: "/hexagons" },
{ name: "About", url: "/about" },
];
const navFooterItems = [
{ name: "Privacy", url: "/privacy" },
{ name: "Terms", url: "/terms-of-service" },
];
<Header
items={navHeaderItems}
brand={<img src={PlasiusLTDLogo} alt="Plasius LTD Logo" />}
profileSlot={
<UserProfile
user={{ firstName: "Ada", lastName: "Lovelace" }}
onOpenSettings={() => console.info("settings")}
onLogout={() => console.info("logout")}
onLogin={(provider) => console.info("login", provider)}
/>
}
/>;
<Footer items={navFooterItems} />;Suitability Checklist
Use @plasius/sharedcomponents as your base package when your component:
- is reusable across products
- can be configured only through props/callbacks
- does not import product/domain stores
- does not require backend/service SDKs directly
Do not add components here if they need app-specific business logic or service wiring.
Development
npm install
npm run build
npm test
npm run test:coverageGovernance & ADRs
- Security policy: SECURITY.md
- Code of conduct: CODE_OF_CONDUCT.md
- ADRs: docs/adrs
- Base package review: docs/base-package-review.md
- Legal docs: legal
License
MIT