بنقرة واحدة
mobile
Generate mobile-specific React components with platform detection and safe areas
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Generate mobile-specific React components with platform detection and safe areas
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | mobile |
| description | Generate mobile-specific React components with platform detection and safe areas |
Generates mobile-specific React components following Skelenote mobile patterns.
sheet - Bottom sheet modalrow - List row componentview - Full-screen viewprimitive - Reusable UI primitiveBased on type, generates in src/components/mobile/{type}s/:
src/components/mobile/sheets/{Name}Sheet.tsx:
import { useState } from 'react';
import { Stack, Text, Button } from '@mantine/core';
import { usePlatform } from '@/hooks/usePlatform';
import { useHaptics } from '@/hooks/useHaptics';
import { BottomSheet } from '../primitives/BottomSheet';
interface {Name}SheetProps {
opened: boolean;
onClose: () => void;
}
export function {Name}Sheet({ opened, onClose }: {Name}SheetProps) {
const { safeAreaInsets } = usePlatform();
const { impact } = useHaptics();
const handleAction = () => {
impact('light');
// Action logic
};
return (
<BottomSheet opened={opened} onClose={onClose}>
<Stack gap="md" pb={safeAreaInsets.bottom}>
{/* Sheet content */}
</Stack>
</BottomSheet>
);
}
src/components/mobile/rows/{Name}Row.tsx:
import { Group, Text, ActionIcon } from '@mantine/core';
import { usePlatform } from '@/hooks/usePlatform';
import { useHaptics } from '@/hooks/useHaptics';
import styles from './{Name}Row.module.css';
interface {Name}RowProps {
item: SomeType;
onPress: () => void;
}
export function {Name}Row({ item, onPress }: {Name}RowProps) {
const { isMobile } = usePlatform();
const { selection } = useHaptics();
const handlePress = () => {
selection();
onPress();
};
return (
<Group className={styles.row} onClick={handlePress}>
{/* Row content */}
</Group>
);
}
src/components/mobile/views/{Name}View.tsx:
import { Stack } from '@mantine/core';
import { usePlatform } from '@/hooks/usePlatform';
import { useScrollDirection } from '@/hooks/useScrollDirection';
import { MobileHeader } from '../primitives/MobileHeader';
import styles from './{Name}View.module.css';
export function {Name}View() {
const { safeAreaInsets } = usePlatform();
const { scrollDirection, scrollRef } = useScrollDirection();
return (
<Stack
className={styles.view}
style={{ paddingTop: safeAreaInsets.top }}
>
<MobileHeader
title="{Name}"
hidden={scrollDirection === 'down'}
/>
<div ref={scrollRef} className={styles.content}>
{/* View content */}
</div>
</Stack>
);
}
| Hook | Purpose |
|---|---|
usePlatform() | Platform detection, safe area insets |
useHaptics() | Haptic feedback (impact, selection, notification) |
useScrollDirection() | Detect scroll for hiding toolbars |
useReducedMotion() | Respect accessibility preference |
Always respect safe areas for notch and home indicator:
const { safeAreaInsets } = usePlatform();
// { top: number, bottom: number, left: number, right: number }
<Stack style={{
paddingTop: safeAreaInsets.top,
paddingBottom: safeAreaInsets.bottom
}}>
usePlatform() for detectionBottomSheet primitiveGenerate a new React component with Mantine styling
Update documentation after implementing features or making changes
Run a quick architecture review via architect-reviewer agent
Run a quick security audit on recent changes or specific files
Generate a test file for a component, hook, or utility
Generate comprehensive tests via test-generator agent