Framer
A container for framed content display with a decorative border, used to visually frame screenshots, artwork, or embedded content.
This headless component uses a <div> element with an optional aria-label for semantic framing of visual content.
Example
Show demo markup
<div class="framer" aria-label="a container for framed content display with decorative border">Framer</div>
Usage example
<Framer label="Screenshot of the application dashboard">
<img src="screenshot.png" alt="Dashboard showing metrics" />
</Framer>
Show Svelte source
// In your Svelte component:
import Framer from "lily-design-system-svelte-headless/components/Framer/Framer.svelte";
<Framer>
<!-- content -->
</Framer>
Usage
<Framer label="Screenshot of the application dashboard">
<img src="screenshot.png" alt="Dashboard showing metrics" />
</Framer>
<Framer label="Artwork: Sunset over the mountains">
<img src="painting.jpg" alt="Oil painting of a sunset over a mountain range" />
</Framer>
<Framer>
<iframe src="https://example.com/embed" title="Interactive demo"></iframe>
</Framer>
Props
label: string (optional) -- accessible label for the framed content
children: slot (required) -- framed content
...restProps: Any additional HTML attributes
Keyboard Interactions
- None -- presentational wrapper; interactive children handle their own keyboard interactions
ARIA
- Optional
aria-label when frame has semantic meaning; otherwise presentational
- When
label is provided, the container is labeled for assistive technology
When to Use
- Use to visually frame screenshots, artwork, or embedded content
- Use to provide a consistent decorative border around visual media
- Use to group and visually distinguish embedded or quoted visual content from surrounding page content
When Not to Use
- Do not use for photos with captions -- use Figure
- Do not use as a generic card -- use Card
- Do not use for layout containers -- use Panel or other layout components
Headless
This component provides a <div> element with an optional aria-label for framing content, with zero visual styling. The consumer is responsible for all CSS including borders, shadows, padding, background color, and responsive sizing.
Styles
The consumer provides all CSS styling. The component renders with a .framer class for targeting. No default styles are included -- this is a fully headless component.
Testing
- Verify the component renders a
<div> element with class framer
- Verify
aria-label is applied when label prop is provided
- Verify
aria-label is omitted when label prop is not provided
- Verify child content is rendered correctly
- Verify pass-through attributes are applied
Advice
- Designers: Design frame styles that complement the content without distracting from it. Consider using subtle borders and shadows. Ensure frame styling works well at different viewport sizes.
- Developers: Only provide a
label prop when the frame adds semantic meaning beyond decoration. For purely decorative frames, omit the label to avoid unnecessary verbosity for screen reader users. Ensure framed images have their own alt text.
Implementation Notes
- Uses
<div> element as a frame container
- Supports optional
aria-label when the frame has semantic meaning
- Consumer provides frame styling (border, shadow, background)
- Can be used for screenshots, artwork, embedded content
Related components
card — a grouped content container with header, body, and footer areas
panel — a generic content panel with optional heading
aspect-ratio-container — a container that maintains a fixed aspect ratio
References
Canonical contract
Generated from this component's canonical metadata — the machine-checked source the implementations are held to.
Metadata
- Component: framer
- PascalCase: Framer
- Description: a container for framed content display with decorative border
- Status: beta — implemented and unit-tested in all seven frameworks with an axe-clean demo page; not yet exercised in composed flows
- HTML tag: <div>
- CSS class: .framer
- Interactive: no
ARIA
- Optional
aria-label when frame has semantic meaning; otherwise presentational
Keyboard
Props
label: string (optional) -- accessible label for the framed content children: slot (required) -- framed content ...restProps: Any additional HTML attributes