Toolverse
All skills

gpui-element

by longbridge

Implementing custom elements using GPUI's low-level Element API (vs. high-level Render/RenderOnce APIs). Use when you need maximum control over layout, prepaint, and paint phases for complex, performance-critical custom UI components that cannot be achieved with

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Frontend
Views
5

About this skill

Implementing custom elements using GPUI's low-level Element API (vs. high-level Render/RenderOnce APIs). Use when you need maximum control over layout, prepaint, and paint phases for complex, performance-critical custom UI components that cannot be achieved with Render/RenderOnce traits.

How to use

  1. Zainstaluj skill gpui-element z repozytorium longbridge — dodaj go do katalogu skills w swoim projekcie GPUI.

  2. Oceń, czy naprawdę potrzebujesz niskopoziomowego API Element. Jeśli budujesz prosty komponent ze standardowym layoutem, preferuj wysokopoziomowe API Render lub RenderOnce — są łatwiejsze i wystarczające.

  3. Zdefiniuj strukturę swojego elementu i zaimplementuj trait Element. Musisz określić dwa typy stanu: RequestLayoutState (dane przekazane do kolejnych faz) i PrepaintState (dane do malowania).

  4. Implementuj metodę request_layout — pierwsza faza, w której obliczasz rozmiary i pozycje elementu. Użyj window.request_layout() z odpowiednim Style i zwróć LayoutId oraz swój RequestLayoutState.

  5. Implementuj metodę prepaint — druga faza, gdzie tworzysz hitboxy i przygotowujesz dane do rysowania. Użyj window.insert_hitbox() z bounds i HitboxBehavior, zwróć PrepaintState.

  6. Implementuj metodę paint — trzecia faza, w której faktycznie rysujesz element na ekranie, korzystając z danych przygotowanych w poprzednich fazach.

Related skills

zustand

by lobehub

Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.

Frontend
36126

senior-fullstack

by davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects,

Frontend
2896

landing-page-guide-v2

by bear2u

Create distinctive, high-converting landing pages that combine proven conversion elements with exceptional design quality. Build beautiful, memorable landing pages using Next.js 14+ and ShadCN UI that avoid generic AI aesthetics while following the 11 essential elements

Frontend
3486

svg-precision

by dkyazzentwatwa

Deterministic SVG generation, validation, and rendering. Use for icons, diagrams, charts, UI mockups, or technical drawings requiring structural correctness and cross-viewer compatibility.

Frontend
233466

browser-automation

by browserbase

Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Triggers include \

Frontend
21175

tailwind-design-system

by wshobson

Build scalable design systems with Tailwind CSS, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

Frontend
2676