Install Apple UI
Choose a typed React package or editable source from the shadcn registry. The guide below covers both routes for a Next.js project using Tailwind CSS.
1Add the source
In a project already configured with shadcn, run this command. The registry adds the library source and dependencies.
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/apple-ui.jsonFor a new Next.js project, initialize shadcn first.
bunx --bun shadcn@latest init2Import the styles
Add the stylesheet once in your root layout. The component CSS works on its own, and you can add Tailwind classes for layout and overrides.
// app/layout.tsx
import '@/components/apple-ui/styles.css';
import './globals.css';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <html lang="en"><body>{children}</body></html>;
}3Build a component
'use client';
import { useState } from 'react';
import { Button, Switch } from '@/components/apple-ui';
export function Preferences() {
const [enabled, setEnabled] = useState(true);
return (
<div className="flex items-center gap-4">
<label className="flex items-center gap-3">
<Switch checked={enabled} onCheckedChange={setEnabled} />
Notifications
</label>
<Button onClick={() => setEnabled(true)}>Enable</Button>
</div>
);
}4Choose an appearance
Set className="dark" on the root element to use dark colors. A theme provider such as next-themes can connect this to the system preference and remember the user’s choice.
/* Your globals.css */
@import 'tailwindcss';
:root {
--aui-accent: #0066cc;
--aui-radius-md: 0.75rem;
}
.dark {
--aui-accent: #0a84ff;
}Use alongside shadcn
Apple UI uses its own aui class and token names, so it can live beside existing shadcn components. Tailwind utilities still work through className. Override Apple UI tokens to change its appearance; existing shadcn theme variables remain separate.
The registry installs a shared source library, including the requested component’s dependencies. Import the components you need from the shared index. Existing shadcn component files are not replaced.
Local themes and overlays
Use ThemeScope when one part of a page has a different appearance. It gives dialogs, menus, tooltips and other portals the same theme and custom token values as their triggers.
<ThemeScope theme="dark" style={{ '--aui-accent': '#6eafff' } as React.CSSProperties}>
<Dialog>
<DialogTrigger asChild><Button>Open dialog</Button></DialogTrigger>
<DialogContent>
<DialogTitle>A local dark theme</DialogTitle>
<DialogDescription>The dialog shares this section's appearance.</DialogDescription>
</DialogContent>
</Dialog>
</ThemeScope>A local data-aui-theme attribute alone cannot carry inherited styles through a portal mounted on the document body. For another mounting location, pass portalContainer to the overlay content. Use portalTheme for an explicit light or dark appearance.
Device frames clip and scroll ordinary content. Their screen does not automatically contain fixed elements or body portals. Mount overlays in a container inside the screen and test their positioning when using frames for interactive app previews.
Add charts
Charts use the same package and stylesheet. Recharts installs with the library. Each chart includes a title, selected values and an optional data table. Use a Client Component when you pass a formatter function.
import { LineChart } from '@/components/apple-ui';
export function Visits() {
return <LineChart
title="Weekly visits"
description="Visits to the project website. Example data."
data={[{ label: 'Mon', visits: 120 }, { label: 'Tue', visits: 156 }]}
series={[{ key: 'visits', label: 'Visits' }]}
/>;
}Versioning and updates
The tarball path includes its version. Pin that URL in your package manifest. For registry source, review local edits before reinstalling. The package includes TypeScript declarations and the original component source.
Download version 0.6.0Download design tokens