Shadcn Dialog Scrolling logo

Shadcn Dialog Scrolling

Organization
prokopai
shadcn-dialog-scrolling

Dialog/modal layout patterns in jean2 client — responsive flex scrolling, mobile PWA safe-area, padding. Load when building or fixing dialogs (DialogContent, ScrollArea not scrolling, mobile overflow/clipping, notched PWA close button).

Overview

Publisherprokopai
Repositoryprokop
Skill nameshadcn-dialog-scrolling
Stars
35
Forks
5
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by prokopai on GitHub. Read the source before you install it.

Installation

Install the Shadcn Dialog Scrolling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/prokopai/prokop/tree/main/.agents/skills/shadcn-dialog-scrolling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/prokopai/prokop.git /tmp/prokop
mkdir -p .claude/skills
cp -r /tmp/prokop/.agents/skills/shadcn-dialog-scrolling .claude/skills/shadcn-dialog-scrolling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Shadcn Dialog Scrolling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Shadcn Dialog Scrolling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Shadcn Dialog Scrolling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Dialog Layout Patterns (jean2 client)

Procedural guide for building/fixing dialogs in packages/client/src/components/modals/.

Key files

  • Base component: packages/client/src/components/ui/dialog.tsx — DialogContent already handles safe-area centering + mobile max-height. Do not override its mobile max-h (see Pitfall #1).
  • Utility: packages/client/src/lib/utils.ts — cn() = twMerge(clsx(...)). Conflicting Tailwind classes are merged with last-wins per property group.

Step 0: Classify the dialog

TypeWhenWidth class example
SimpleContent always fits viewport (confirm, short forms)sm:max-w-[425px]
ScrollingContent may exceed viewport (lists, settings, config)sm:max-w-[800px] sm:max-h-[85vh] + flex layout

Simple dialogs: just pass width to DialogContent, done. No flex, no scroll wrapper.

Step 1: Scrolling dialog — the correct layout

tsx
<DialogContent className="flex flex-col overflow-hidden p-3 sm:p-4 gap-3 sm:gap-4 max-w-[calc(100vw-0.5rem)] sm:max-w-[800px] sm:max-h-[85vh]">
  <DialogHeader className="shrink-0">
    <DialogTitle>Title</DialogTitle>
    <DialogDescription>Subtitle</DialogDescription>
  </DialogHeader>

  {/* Scrollable content — plain div, NOT ScrollArea */}
  <div className="flex-1 min-h-0 overflow-y-auto overscroll-contain rounded-lg border">
    {/* panel content */}
  </div>
</DialogContent>

Every piece matters:

  • flex flex-col overflow-hidden on DialogContent — overrides base grid (tailwind-merge last-wins)
  • shrink-0 on header — prevents it from being squeezed
  • flex-1 min-h-0 overflow-y-auto on the scroll container — min-h-0 is mandatory; without it the flex item won't shrink below content height and will never scroll
  • overscroll-contain — prevents scroll chaining to the page behind the dialog

Step 2: Tabs + sidebar variant (Configuration/Settings pattern)

For dialogs with a left sidebar (desktop) + dropdown (mobile):

tsx
<DialogContent className="flex flex-col overflow-hidden p-3 sm:p-4 gap-3 sm:gap-4 ... sm:max-h-[85vh]">
  <DialogHeader className="shrink-0">...</DialogHeader>

  {/* Mobile dropdown */}
  <SelectTrigger className="sm:hidden w-full shrink-0" />

  <Tabs orientation="vertical" className="mt-2 flex-1 min-h-0">
    <TabsList className="hidden sm:flex flex-col h-fit w-44 shrink-0 ..." />

    {/* Scrollable content area */}
    <div className="flex-1 min-w-0 min-h-0 overflow-y-auto overscroll-contain rounded-lg border">
      <TabsContent value="x" className="mt-0">...</TabsContent>
    </div>
  </Tabs>
</DialogContent>

Step 3: Mobile padding

Panels inside the scroll area should use p-3 sm:p-4 (not bare p-4) to avoid clipping on narrow PWA screens. The dialog padding (p-3 sm:p-4) + panel padding stack, so on mobile you get 24px total instead of 32px.

Pitfalls (all hit during this work)

#1 — tailwind-merge kills base safe-area (CRITICAL)

DialogContent base has max-h-[calc(100dvh-env(safe-area-inset-top,0px))] for notch protection. If you pass max-h-[calc(100dvh-2rem)], tailwind-merge sees the same max-h group and keeps only yours — silently discarding safe-area protection. The close button ends up behind the notch. Fix: Never pass a mobile max-h. Only pass sm:max-h-[85vh] (different breakpoint, no conflict).

#2 — Radix ScrollArea doesn't scroll in flex dialogs

ScrollArea (@/components/ui/scroll-area) Root/Viewport use size-full (percentage height). When the parent's height comes from flex/max-height clamping (not explicit height), percentage height resolves to auto → ScrollArea grows to full content → never constrains → never scrolls. This is flaky across browsers, especially mobile WebKit. Tried and all failed: h-full, flex-1 min-h-0, absolute inset-0 inside relative wrapper. Fix: Replace ScrollArea with a plain <div className="flex-1 min-h-0 overflow-y-auto overscroll-contain">. Remove the ScrollArea import.

#3 — Fixed-pixel ScrollArea heights

Older dialogs (MCP, WorkspacePermissions) use <ScrollArea className="h-[400px]">. This works because fixed pixels ARE a definite height, but it's fragile (magic number, doesn't adapt). When touching these, convert to the flex pattern.

#4 — Magic-number heights

Never use h-[calc(100dvh-18rem)] or sm:h-[500px]. These don't adapt to actual dialog size. Use flex-1 min-h-0 to fill available space.

#5 — Close button behind notch

Already handled in the base DialogContent via safe-region centering (top-[calc(50dvh+env(safe-area-inset-top,0px)/2)]). Only breaks if you override mobile max-h (see #1).

#6 — Unstyled native scrollbar

Plain <div className="overflow-y-auto"> shows the browser's default scrollbar (chunky, unstyled). Add the .dialog-scrollbar class (defined in index.css) to match the app's aesthetic: thin (6px), transparent track, muted-foreground thumb at 35% opacity, 55% on hover.

#7 — Dialog height jumps when switching tabs

Using sm:max-h-[85vh] lets the dialog shrink to fit each panel's content, causing layout jumps when switching tabs. Use a fixed height h-[85dvh] sm:h-[85vh] instead so the dialog stays a constant size — only the inner scroll area changes.

Verification

  1. cd packages/client && bunx tsc --noEmit -p tsconfig.json — must pass (0 errors)
  2. bunx eslint <changed-files> — must pass
  3. Manual: open dialog on mobile PWA viewport — close button tappable, content scrolls, nothing clips

Frequently asked questions

What does the Shadcn Dialog Scrolling AI skill do?

Dialog/modal layout patterns in jean2 client — responsive flex scrolling, mobile PWA safe-area, padding. Load when building or fixing dialogs (DialogContent, ScrollArea not scrolling, mobile overflow/clipping, notched PWA close button).

Why use Shadcn Dialog Scrolling on TypingMind?

Because you install it once and use it with any model. Shadcn Dialog Scrolling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Shadcn Dialog Scrolling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/prokopai/prokop/tree/main/.agents/skills/shadcn-dialog-scrolling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Shadcn Dialog Scrolling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Shadcn Dialog Scrolling?

As many as you like. As long as a model supports skills, you can use Shadcn Dialog Scrolling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Shadcn Dialog Scrolling AI skill free?

Yes. It is published on GitHub by prokopai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇