Frame for Astro
Frame components for a subtle raised surface.
FramePanel adds a subtle raised surface to a single element. Frame groups several panels (and optional header or footer) inside one muted shell.
Installation
bunx --bun shadcn@latest add @gnostic/framenpx shadcn@latest add @gnostic/framepnpm dlx shadcn@latest add @gnostic/frameCopy the files
src/components/ui/frame/frame-description.astrosrc/components/ui/frame/frame-footer.astrosrc/components/ui/frame/frame-header.astrosrc/components/ui/frame/frame-panel.astrosrc/components/ui/frame/frame-title.astrosrc/components/ui/frame/frame.astrosrc/components/ui/frame/index.ts
Usage
---
import {
Frame,
FrameDescription,
FrameFooter,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/ui/frame"
---
<Frame>
<FrameHeader>
<FrameTitle>Title</FrameTitle>
<FrameDescription>Description</FrameDescription>
</FrameHeader>
<FramePanel>Content</FramePanel>
<FrameFooter>Footer</FrameFooter>
</Frame>
Composition
Frame
├── FrameHeader
│ ├── FrameTitle
│ └── FrameDescription
├── FramePanel
└── FrameFooter
Examples
Framed icon
Use FramePanel around an icon to make it stand out.
See the card examples for CardFrame, which clips a card into a framed shell.
When to use Frame
Use FramePanel alone when one raised surface is enough, as in the framed icon example. Use Frame when multiple panels should sit together in one outer surface.
Keyboard and behavior
Frame supplies layout, not selection or disclosure behavior. Use semantic headings and actual buttons inside the parts. The page still owns heading levels and landmarks.
Theme and layout
With Frame, the outer muted shell and inner panels share border and radius tokens. A lone FramePanel uses the panel tokens only. Check panel edges and spacing when content includes a table or a card with its own border. Avoid stacking unnecessary surfaces.
