Use the low-level Element trait when:
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiongpui-elementExecute the skills CLI command in your project's root directory to begin installation:
Fetches gpui-element from longbridge/gpui-component and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate gpui-element. Access via /gpui-element in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
10.9K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
10.9K
stars
Use the low-level Element trait when:
Render/RenderOnce APIs are insufficientPrefer Render/RenderOnce for: Simple components, standard layouts, declarative UI
The Element trait provides direct control over three rendering phases:
impl Element for MyElement {
type RequestLayoutState = MyLayoutState; // Data passed to later phases
type PrepaintState = MyPaintState; // Data for painting
fn id(&self) -> Option<ElementId> {
Some(self.id.clone())
}
fn source_location(&self) -> Option<&'static std::panic::Location<'static>> {
None
}
// Phase 1: Calculate sizes and positions
fn request_layout(&mut self, .., window: &mut Window, cx: &mut App)
-> (LayoutId, Self::RequestLayoutState)
{
let layout_id = window.request_layout(
Style { size: size(px(200.), px(100.)), ..default() },
vec![],
cx
);
(layout_id, MyLayoutState { /* ... */ })
}
// Phase 2: Create hitboxes, prepare for painting
fn prepaint(&mut self, .., bounds: Bounds<Pixels>, layout: &mut Self::RequestLayoutState,
window: &mut Window, cx: &mut App) -> Self::PrepaintState
{
let hitbox = window.insert_hitbox(bounds, HitboxBehavior::Normal);
MyPaintState { hitbox }
}
// Phase 3: Render and handle interactions
fn paint(&mut self, .., bounds: Bounds<Pixels>, layout: &mut Self::RequestLayoutState,
paint_state: &mut Self::PrepaintState, window: &mut Window, cx: &mut App)
{
window.paint_quad(paint_quad(bounds, Corners::all(px(4.)), cx.theme().background));
window.on_mouse_event({
let hitbox = paint_state.hitbox.clone();
move |event: &MouseDownEvent, phase, window, cx| {
if hitbox.is_hovered(window) && phase.bubble() {
// Handle interaction
cx.stop_propagation();
}
}
});
}
}
// Enable element to be used as child
impl IntoElement for MyElement {
type Element = Self;
fn into_element(self) -> Self::Element { self }
}
RequestLayoutState → PrepaintState → paint
State flows in one direction through associated types, passed as mutable references between phases.
window.request_layout(style, children, cx) - Create layout nodewindow.insert_hitbox(bounds, behavior) - Create interaction areawindow.paint_quad(...) - Render visual contentwindow.on_mouse_event(handler) - Handle user inputExamples: See examples.md
Best Practices: See best-practices.md
Common Patterns: See patterns.md
Advanced Patterns: See advanced-patterns.md
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
leonxlnx/taste-skill
sickn33/antigravity-awesome-skills
erichowens/some_claude_skills
Registry listing for gpui-element matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: gpui-element is the kind of skill you can hand to a new teammate without a long onboarding doc.
Useful defaults in gpui-element — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Registry listing for gpui-element matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: gpui-element is the kind of skill you can hand to a new teammate without a long onboarding doc.
gpui-element is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
gpui-element reduced setup friction for our internal harness; good balance of opinion and flexibility.
Keeps context tight: gpui-element is the kind of skill you can hand to a new teammate without a long onboarding doc.
gpui-element is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
gpui-element has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 38