Guidelines and patterns for building efficient UI components, grids, and layouts in Datagrok TypeScript packages.

Install

mkdir -p .claude/skills/ui-datagrok-ai && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11867" && unzip -o skill.zip -d .claude/skills/ui-datagrok-ai && rm skill.zip

Installs to .claude/skills/ui-datagrok-ai

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

UI building guidelines for Datagrok TypeScript components, viewers, and drag-and-drop
85 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Add lazy-loading panes to tab controls
  • Embed grids within composite layouts
  • Create resizable split panels
  • Define typed inputs for dialogs
  • Manage toggle settings in popup menus
  • Implement drag-and-drop functionality

How it works

The skill provides guidelines and patterns for building UI components in Datagrok TypeScript packages, emphasizing efficient rendering and interaction.

Inputs & outputs

You give it
TypeScript code for UI components
You get back
Datagrok UI elements

When to use ui

  • Create a new UI component or viewer
  • Implement lazy-loading tabs
  • Build a resizable split panel layout
  • Define typed inputs for dialogs

About this skill

Datagrok UI Building Guidelines

Rules and patterns for building UI in TypeScript packages and libraries. These are authoritative — follow them unless the user explicitly overrides.

Tab Controls

  • Always use addPane with a lazy getContent callback — never pass pre-built elements
  • This avoids creating heavy components (grids, viewers, DataFrames) for tabs the user may never open
// Good
const tabs = ui.tabControl();
tabs.addPane('Sheet 1', () => {
  const df = buildDataFrame();
  const grid = DG.Viewer.grid(df);
  return grid.root;
});

// Bad — all tabs built eagerly
const tabs = ui.tabControl({
  'Sheet 1': buildExpensiveGrid(),
  'Sheet 2': buildExpensiveGrid(),
});

Grids and Viewers

  • Prefer DG.Viewer.grid(df) for embedding a grid inside a composite layout
  • Prefer DG.TableView.create(df, false) when the grid IS the entire view
  • The second argument (false) prevents the table from being added to the workspace

Layouts

  • Use ui.splitH / ui.splitV for resizable split panels
  • Use ui.divV / ui.divH for simple stacking without resize handles
  • Set flex: 1 on the element that should fill remaining space
  • For tree + content layouts, use ui.splitH([tree.root, contentPanel])

Dialogs and Inputs

  • Use ui.dialog() for modal interactions
  • Use ui.input.choice(), ui.input.int(), ui.input.bool(), etc. for typed inputs - full set of input functions is in js-api/ui.ts. Prefer onValueChanged in the options object over .onChanged.subscribe():
  ui.input.bool('Debug', {value: DG.Test.isInDebug, onValueChanged: (v) => DG.Test.isInDebug = v});

Use ui.form([...inputs]) to render a labeled list of inputs inside a dialog

  • For property panels, prefer DG.JsViewer properties (this.string(...), this.int(...)) which automatically appear in the context panel

Toggle Settings in Popup Menus

For toggleable settings in a DG.Menu.popup(), use menu.items() with isCheckednever use text-prefix hacks like `${flag ? '✓ ' : ''}Label`:

const toggles = [
  {label: 'Debug', get: () => DG.Test.isInDebug, set: (v: boolean) => { DG.Test.isInDebug = v; }},
  {label: 'Benchmark', get: () => DG.Test.isInBenchmark, set: (v: boolean) => { DG.Test.isInBenchmark = v; }},
];
const menu = DG.Menu.popup();
menu.closeOnClick = false;
const refresh = () => {
  menu.clear();
  menu.items(toggles, (t) => { t.set(!t.get()); refresh(); }, {isChecked: (t) => t.get()});
};
refresh();
menu.show();

Performance

  • Debounce resize and selection handlers: DG.debounce(observable, 50)
  • For large datasets, prefer canvas-based rendering over DOM elements
  • Avoid re-creating viewers on every data change — update in place when possible

Accordion

  • Use ui.accordion() with lazy getContent callbacks (same principle as tab controls)
const acc = ui.accordion();
acc.addPane('Details', () => buildDetailsPanel());
acc.addPane('Statistics', () => buildStatsPanel());

Drag and Drop

  • ui.makeDroppable(el, IDragAndDropOptions<T>) — receive entities dragged from the browse tree, grid, or other sources.
    • acceptDrop(obj) — fast predicate for showing the zone.
    • doDrop(args) — handle the drop. args is a DragDropArgs<T> with dragObject, dragSource, dragObjectType, copying (Ctrl/Cmd), link (Alt), handled.
    • Rich hooks: acceptDrag, onBeginDrag, onEndDrag, onMouseEnter/Over/Leave/Out, dropSuggestion, makeDropZone, dropZoneRectTransformation, dropIndication.
  • ui.makeDraggable(el, {getDragObject, getDragCaption}) — make your own UI a drag source.
  • Sample: ApiSamples/scripts/ui/interactivity/drag-and-drop.js.

Common Anti-Patterns

  • Do not use raw document.createElement when ui.* helpers exist
  • Do not set innerHTML with user data — use ui.divText() or textContent
  • Do not use style.width = '100%' on tables — let them size to content
  • Do not build all content eagerly in multi-pane layouts (tabs, accordions)

When not to use it

  • When building all content eagerly in multi-pane layouts
  • When using raw document.createElement for UI elements
  • When setting innerHTML with user data

Limitations

  • The guidelines are specific to Datagrok TypeScript packages and libraries.
  • The skill does not support eager loading of content in multi-pane layouts.

How it compares

This skill provides specific Datagrok UI helpers and patterns, unlike manual DOM manipulation, to ensure consistency and performance.

Compared to similar skills

ui side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ui (this skill)03moNo flagsIntermediate
scroll-experience1016moNo flagsIntermediate
anthropic-frontend-design126moNo flagsIntermediate
infographic-structure-creator15moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

scroll-experience

davila7

Expert in building immersive scroll-driven experiences - parallax storytelling, scroll animations, interactive narratives, and cinematic web experiences. Like NY Times interactives, Apple product pages, and award-winning web experiences. Makes websites feel like experiences, not just pages. Use when: scroll animation, parallax, scroll storytelling, interactive story, cinematic website.

101142

anthropic-frontend-design

chaibuilder

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

1237

infographic-structure-creator

antvis

Generate or update infographic Structure components for this repo (TypeScript/TSX in src/designs/structures). Use when asked to design, implement, or modify structure layouts (list/compare/sequence/hierarchy/relation/geo/chart), including layout logic, component composition, and registration.

110

logo-with-variants

crafter-station

Create logo components with multiple variants (icon, wordmark, logo) and light/dark modes. Use when the user provides logo SVG files and wants to create a variant-based logo component following the Clerk pattern in the Elements project.

47

design-context

WellApp-ai

Refresh UI/UX context from design system, Storybook, and codebase

17

threejs-postprocessing

CloudAI-X

Three.js post-processing - EffectComposer, bloom, DOF, screen effects. Use when adding visual effects, color grading, blur, glow, or creating custom screen-space shaders.

17

Search skills

Search the agent skills registry