كتلة الكود Code Block
مربع داكن فيه كود بخط ثابت العرض، مع ألوان للكلمات، وزر نسخ في الزاوية.
<pre><code>متى تستخدمه
في التوثيق والمقالات التقنية.
خطأ شائع
لا تلفّ أسطر الكود؛ اتركها قابلة للتمرير.
إمكانية الوصول
Keep it horizontally scrollable and label the copy button.
اسمه في الكود
| HTML/CSS | <pre><code> |
|---|---|
| React | Shiki / Prism + copy button |
| Jetpack Compose | Text(fontFamily = Monospace) |
| SwiftUI | Text + .monospaced() |
برومبت جاهز لوكيل البرمجة
Add a Code Block to this screen.
What it is: A dark box with monospaced code, syntax colors and a copy button in the corner.
Implement with: <pre><code> (HTML/CSS).
Accessibility: Keep it horizontally scrollable and label the copy button.
When to use it: In documentation and technical articles.
Avoid: Don’t wrap code lines; let them scroll.
Reuse the project's existing design tokens, spacing and component conventions.
أو ركّب صفحة كاملة من هذا العنصر وغيره →
البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.