About
An Astryx side panel for inspectors and detail views. It overlays the page, supports desktop and touch layouts, and can close with Escape, the scrim, or its close button. Astryx by Meta. Source: https://astryx.atmeta.com/components/Drawer
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Drawer to your project and fits it to your theme.
Code
How Astryx Drawer is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-drawer.tsx. */
/**
* @input Controlled open state for a modal Drawer
* @output A single-trigger drawer with a scrim and a DrawerHeader close button
* @position Drawer's docsite showcase and copyable CLI block
*/
import '@/components/ui/astryx-drawer-utils/astryx-preview.css';
import {useState} from 'react';
import {Drawer, DrawerHeader} from '@/components/ui/astryx-drawer';
import {Button} from '@astryxdesign/core/Button';
import {Layout, LayoutContent} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';
function OfficialSample() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
<Button label="Open drawer" onClick={() => setIsOpen(true)} />
<Drawer
isOpen={isOpen}
onOpenChange={setIsOpen}
label="Details"
width={360}>
<Layout
header={<DrawerHeader title="Details" onOpenChange={setIsOpen} />}
content={
<LayoutContent>
<Text type="body">
Close with Escape, the scrim, or the close button.
</Text>
</LayoutContent>
}
/>
</Drawer>
</>
);
}
export default function Demo() {
return (
<div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
<div className="astryx-demo-content" data-centered style={{maxWidth: 320}}>
<OfficialSample />
</div>
</div>
);
}















