[ Data Display ]
FrameCard
A content panel inside a colored frame. The frame holds an optional title, a footer action and a pager, and the panel can collapse.
Import#
import { FrameCard } from 'reusify-ui';When to use#
- Dashboard widgets such as task lists, members or schedules that need a strong color identity.
- Grouping a small list with "view all" and paging actions.
- Use a plain Card when the content does not need a frame or footer actions.
Examples#
Collapsible with footer#
collapsible adds a chevron toggle to the panel header. Pass onPrev / onNext to show the pager; leave one out to disable that arrow.
Tasks Project
<FrameCard
title="Tasks Project"
collapsible
footer={<button className="ru-frame-card__link">View All Tasks</button>}
onPrev={prev}
onNext={next}
>
<Checkbox color="warning" label="Design Homepage" defaultChecked />
<Checkbox color="warning" label="Update Backend" />
<Checkbox color="warning" label="Add Content" />
</FrameCard>Title on the frame#
titlePlacement="frame" moves the title and pager onto the frame above the panel.
Start Project
Panel content goes here.
<FrameCard title="Start Project" color="#2563eb" titlePlacement="frame" onPrev={prev} onNext={next}>
…
</FrameCard>Colors#
color takes a semantic name or any CSS color. The frame gradient, shadow and footer ink all come from it. Use textColor to override the text on the frame.
Success
success
Sky
#38bdf8
Ink
#18181b
<FrameCard title="Success" color="success" titlePlacement="frame" />
<FrameCard title="Sky" color="#38bdf8" titlePlacement="frame" />
<FrameCard title="Ink" color="#18181b" titlePlacement="frame" />Header action#
headerAction renders any element next to the title, such as a menu button.
Members
4 people on this project.
<FrameCard
title="Members"
color="info"
headerAction={<Button variant="ghost" size="sm" iconOnly aria-label="More"><FiMoreHorizontal /></Button>}
>
…
</FrameCard>Used in designs#
FrameCard in real layouts: these 6 designs use it. Open one to try it and copy the code.
- Tasks ProjectDashboard widgets
- Members ProjectsDashboard widgets
- Start ProjectDashboard widgets
- Invite teammatesAuthentication
- Pricing planPricing & billing
- NotificationsSettings & profile
API reference#
<FrameCard />
Renders a <section> and forwards the remaining props to it. Use the ru-frame-card__link class for text footer actions.
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | - | Heading text. |
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | string | 'warning' | Frame color. |
textColor | string | - | Color of the text on the frame (title and footer). |
titlePlacement | 'panel' | 'frame' | 'panel' | Where the title sits. |
collapsible | boolean | false | Shows a collapse toggle in the panel header. |
open / defaultOpen | boolean | true | Controlled / initial open state. |
onOpenChange | (open: boolean) => void | - | Called when the panel is toggled. |
headerAction | ReactNode | - | Element next to the title. On the frame it replaces the pager. |
footer | ReactNode | - | Content on the bottom edge of the frame. |
onPrev / onNext | () => void | - | Shows the pager. A missing handler disables that arrow. |
prevLabel / nextLabel | string | 'Previous' / 'Next' | Accessible names for the pager buttons. |
title-ReactNodeHeading text.
color'warning''primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | stringFrame color.
textColor-stringColor of the text on the frame (title and footer).
titlePlacement'panel''panel' | 'frame'Where the title sits.
collapsiblefalsebooleanShows a collapse toggle in the panel header.
open / defaultOpentruebooleanControlled / initial open state.
onOpenChange-(open: boolean) => voidCalled when the panel is toggled.
headerAction-ReactNodeElement next to the title. On the frame it replaces the pager.
footer-ReactNodeContent on the bottom edge of the frame.
onPrev / onNext-() => voidShows the pager. A missing handler disables that arrow.
prevLabel / nextLabel'Previous' / 'Next'stringAccessible names for the pager buttons.
Accessibility#
- The title is an <h3> inside a <section>.
- The collapse toggle sets aria-expanded and aria-controls.
- Pager buttons have accessible names you can customize with prevLabel / nextLabel.