andershi666/lobehub-hr-demo/modal

Claude Code and agent skill by andershi666/lobehub-hr-demo

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Modal imperative API guide. Use when creating modal dialogs using createModal from @lobehub/ui. Triggers on modal component implementation or dialog creation tasks.

Install

npx vskill@latest install andershi666/lobehub-hr-demo/modal

SKILL.md

The same SKILL.md was published earlier as andershi666/lobehub-hr-demo/modal.

Modal Imperative API Guide

Use createModal from @lobehub/ui for imperative modal dialogs.

Why Imperative?

ModeCharacteristicsRecommended
DeclarativeNeed open state, render <Modal />❌
ImperativeCall function directly, no state✅

File Structure

features/
└── MyFeatureModal/
├── index.tsx # Export createXxxModal
└── MyFeatureContent.tsx # Modal content

Implementation

1. Content Component (MyFeatureContent.tsx)
tsx
'use client';
import { useModalContext } from '@lobehub/ui';
import { useTranslation } from 'react-i18next';
export const MyFeatureContent = () => {
const { t } = useTranslation('namespace');
const { close } = useModalContext(); // Optional: get close method
return <div>{/* Modal content */}</div>;
};
2. Export createModal (index.tsx)
tsx
'use client';
import { createModal } from '@lobehub/ui';
import { t } from 'i18next'; // Note: use i18next, not react-i18next
import { MyFeatureContent } from './MyFeatureContent';
export const createMyFeatureModal = () =>
createModal({
allowFullscreen: true,
children: <MyFeatureContent />,
destroyOnHidden: false,
footer: null,
styles: { body: { overflow: 'hidden', padding: 0 } },
title: t('myFeature.title', { ns: 'setting' }),
width: 'min(80%, 800px)',
});
3. Usage
tsx
import { createMyFeatureModal } from '@/features/MyFeatureModal';
const handleOpen = useCallback(() => {
createMyFeatureModal();
}, []);
return <Button onClick={handleOpen}>Open</Button>;

i18n Handling

  • Content component: useTranslation hook (React context)
  • createModal params: import { t } from 'i18next' (non-hook, imperative)

useModalContext Hook

tsx
const { close, setCanDismissByClickOutside } = useModalContext();

Common Config

PropertyTypeDescription
allowFullscreenbooleanAllow fullscreen mode
destroyOnHiddenbooleanDestroy content on close
footer`ReactNode \null`Footer content
width`string \number`Modal width

Examples

  • src/features/SkillStore/index.tsx
  • src/features/LibraryModal/CreateNew/index.tsx

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/andershi666/lobehub-hr-demo/modal/badge)](https://verified-skill.com/skills/andershi666/lobehub-hr-demo/modal)

Something wrong with this skill or its page? Tell us.