Menubar
A menu bar providing commands and options for your application.
Derived from Palermo's Toolbar, ghost buttons and Dropdown Menu.
import { Menubar } from "@replicas/ui";
export default function MenubarDemo() {
return (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger>File</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>⌘</Menubar.Shortcut>
<Menubar.Shortcut>N</Menubar.Shortcut>
</>
}
>
New file
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>⌘</Menubar.Shortcut>
<Menubar.Shortcut>D</Menubar.Shortcut>
</>
}
>
Duplicate
</Menubar.Item>
<Menubar.Separator />
<Menubar.Item>Archive</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger>View</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item>Grid</Menubar.Item>
<Menubar.Item>List</Menubar.Item>
<Menubar.Separator />
<Menubar.Item>Show hidden files</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger>Go</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>H</Menubar.Shortcut>
</>
}
>
Home
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>R</Menubar.Shortcut>
</>
}
>
Recent
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>S</Menubar.Shortcut>
</>
}
>
Shared with me
</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
</Menubar.Root>
);
}Prompt
Copy Prompt hands your agent everything it needs to build the Menubar in the Palermo style: the measured tokens, the CSS and the structure.
Show Prompt
# Palermo Menubar
A menu bar providing commands and options for your application.
Build a Menubar in this project that looks and behaves like Palermo's. Measured from the running Palermo app (palermo.tryprofound.com). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or [Base UI](https://base-ui.com/react/components/menubar) if it has none.
Fidelity: Derived from Palermo's Toolbar, ghost buttons and Dropdown Menu.
## Tokens
| Token | Light | Dark |
| --- | --- | --- |
| `--color-bg-primary` | `#fff` | `#171615` |
| `--color-control-selected` | `#f1f1f1` | `#383735` |
| `--text-quaternary` | `#b4b4b4` | `#676563` |
| `--ghost-text` | `#18181a` | `#ecebe9` |
| `--ghost-bg-hover` | `#0000000d` | `#d6d5d412` |
| `--shadow-low` | `var(--surface-shadow-low), var(--shadow-border)` | `var(--surface-shadow-low), var(--shadow-border)` |
| `--focus-ring` | `#006bff` | `#006bff` |
| `--font-size-small` | `0.8125rem` | `0.8125rem` |
| `--line-height-small` | `18px` | `18px` |
| `--font-weight-medium` | `500` | `500` |
| `--radius-control` | `8px` | `8px` |
| `--radius-10` | `10px` | `10px` |
## CSS
Scoped under `[data-style="palermo"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.
```css
[data-style="palermo"] {
.ui-menubar {
box-sizing: border-box;
display: flex;
align-items: center;
gap: 2px;
padding: 4px;
border-radius: var(--radius-10);
background-color: var(--color-bg-primary);
box-shadow: var(--shadow-low);
}
.ui-menubar-trigger {
box-sizing: border-box;
display: inline-flex;
align-items: center;
height: 28px;
margin: 0;
padding: 0 8px;
border: 0;
border-radius: var(--radius-control);
background-color: transparent;
color: var(--ghost-text);
font-family: inherit;
font-size: var(--font-size-small);
font-weight: var(--font-weight-medium);
line-height: var(--line-height-small);
white-space: nowrap;
user-select: none;
cursor: pointer;
outline: none;
@media (hover: hover) {
&:hover:not([data-disabled]) {
background-color: var(--ghost-bg-hover);
}
}
&[data-popup-open] {
background-color: var(--color-control-selected);
}
&:focus-visible {
outline: 1px solid var(--focus-ring);
outline-offset: -1px;
}
&[data-disabled] {
color: var(--text-quaternary);
cursor: not-allowed;
}
}
}
```
## Structure
How Replicas assembles it on Base UI.
```tsx
import { Menu as BaseMenu } from "@base-ui/react/menu";
import { Menubar as BaseMenubar } from "@base-ui/react/menubar";
import { Menu } from "./menu";
const join = (base: string, extra?: string) => (extra ? `${base} ${extra}` : base);
function Root({ className, ...props }: Omit<BaseMenubar.Props, "className"> & { className?: string }) {
return <BaseMenubar className={join("ui-menubar", className)} {...props} />;
}
function Trigger({ className, ...props }: Omit<BaseMenu.Trigger.Props, "className"> & { className?: string }) {
return <BaseMenu.Trigger className={join("ui-menubar-trigger", className)} {...props} />;
}
export const Menubar = {
Root,
Menu: BaseMenu.Root,
Trigger,
Popup: Menu.Popup,
Item: Menu.Item,
Separator: Menu.Separator,
Shortcut: Menu.Shortcut,
};
```
## Example
```tsx
import { Menubar } from "@replicas/ui";
export default function MenubarDemo() {
return (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger>File</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>⌘</Menubar.Shortcut>
<Menubar.Shortcut>N</Menubar.Shortcut>
</>
}
>
New file
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>⌘</Menubar.Shortcut>
<Menubar.Shortcut>D</Menubar.Shortcut>
</>
}
>
Duplicate
</Menubar.Item>
<Menubar.Separator />
<Menubar.Item>Archive</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger>View</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item>Grid</Menubar.Item>
<Menubar.Item>List</Menubar.Item>
<Menubar.Separator />
<Menubar.Item>Show hidden files</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger>Go</Menubar.Trigger>
<Menubar.Popup>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>H</Menubar.Shortcut>
</>
}
>
Home
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>R</Menubar.Shortcut>
</>
}
>
Recent
</Menubar.Item>
<Menubar.Item
shortcut={
<>
<Menubar.Shortcut>G</Menubar.Shortcut>then<Menubar.Shortcut>S</Menubar.Shortcut>
</>
}
>
Shared with me
</Menubar.Item>
</Menubar.Popup>
</Menubar.Menu>
</Menubar.Root>
);
}
```
## Foundations
The rest of the Palermo style, as a skill: https://replicas.raphaelsalaja.com/skills/palermo/SKILL.md