polaris-plus-ui
v0.1.0
Published
React wrappers for Shopify Polaris Web Components
Maintainers
Readme
polaris-plus-ui
React wrappers for Shopify Polaris Web Components.
No @shopify/polaris React dependency required — just the Polaris Web Components CDN script.
Setup
Load the Polaris Web Components script once in your app's root:
<!-- HTML / Next.js layout -->
<script src="https://cdn.shopify.com/polaris-web-components.js"></script>Or with Next.js Script:
import Script from "next/script";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
<Script src="https://cdn.shopify.com/polaris-web-components.js" strategy="beforeInteractive" />
{children}
</body>
</html>
);
}Installation
npm install polaris-plus-uiComponents
AppPage
A full page layout with title, optional subtitle, and a layout section.
import { AppPage } from "polaris-plus-ui";
<AppPage title="Orders" subtitle="Manage your store orders">
{/* page content */}
</AppPage>| Prop | Type | Required | Description |
|------|------|----------|-------------|
| title | string | ✅ | Page heading |
| subtitle | string | — | Page subheading |
| children | ReactNode | ✅ | Page content |
PageSection
A typed wrapper for polaris-layout-section, for use inside AppPage or any polaris-layout.
import { AppPage, PageSection } from "polaris-plus-ui";
<AppPage title="Dashboard">
<PageSection variant="oneHalf">
{/* left column */}
</PageSection>
<PageSection variant="oneHalf">
{/* right column */}
</PageSection>
</AppPage>| Prop | Type | Default | Description |
|------|------|---------|-------------|
| children | ReactNode | — | Section content |
| variant | "oneThird" \| "oneHalf" \| "fullWidth" | — | Layout width |
StatusCard
A Polaris card with a header, optional status badge, content area, and optional footer.
import { StatusCard } from "polaris-plus-ui";
<StatusCard
title="Payment gateway"
badge="Active"
badgeTone="success"
footer={<span>Last synced 5 minutes ago</span>}
>
<p>Stripe is connected and processing payments.</p>
</StatusCard>| Prop | Type | Default | Description |
|------|------|---------|-------------|
| title | string | — | Card heading |
| badge | string | — | Badge label |
| badgeTone | "info" \| "success" \| "warning" \| "critical" | "info" | Badge color |
| children | ReactNode | — | Card body content |
| footer | ReactNode | — | Footer content below divider |
Peer Dependencies
| Package | Version |
|---------|---------|
| react | >=18 |
| react-dom | >=18 |
License
MIT
