Components
AdminShell
v1.0.0Top-level Meteorack admin shell with sidebar, admin bar, and content frame.
Import
import { AdminShell } from '@meteorack/sdk-react';How To Use It
- Use it only for full wp-admin takeover surfaces where a module replaces the native admin chrome with the Meteorack shell.
- Do not use AdminShell for normal embedded module pages that already live inside the standard WordPress admin frame.
Works Well With
Props
sidebar: ReactNodeNavigation region, typically a configured Sidebar component.
adminBar: ReactNodeTop banner region, typically an AdminBar component.
children: ReactNodeMain routed content area rendered inside the shell body.
notifications?: ReactNodeOptional overlay notifications region, such as a Toast container.
commandPalette?: ReactNodeOptional spotlight or command palette mounted above the shell.
Example
AdminShell.tsx
import { useState } from 'react';
import {
AdminShell,
AdminBar,
Sidebar,
PageHeader,
Card,
Button,
} from '@meteorack/sdk-react';
const sections = [
{
label: 'Workspace',
items: [
{ slug: 'dashboard', label: 'Dashboard' },
{ slug: 'settings', label: 'Settings' },
],
},
];
export function TakeoverShell() {
const [activeSlug, setActiveSlug] = useState('dashboard');
const [collapsed, setCollapsed] = useState(false);
return (
<AdminShell
adminBar={
<AdminBar
siteName="Meteorack"
center={<span>Admin takeover</span>}
actions={
<Button variant="ghost" size="sm">
Sign out
</Button>
}
/>
}
sidebar={
<Sidebar
sections={sections}
activeSlug={activeSlug}
collapsed={collapsed}
onNavigate={setActiveSlug}
onToggleCollapse={() => setCollapsed((value) => !value)}
/>
}
>
<PageHeader
title="Admin takeover shell"
description="Full wp-admin replacement for Meteorack surfaces."
/>
<Card>Current route: {activeSlug}</Card>
</AdminShell>
);
}