الانتقال إلى المحتوى الرئيسي

نظرة عامة

يعرض CommandBlock كل أمر مُقدَّم مع علامة موجّه. لا ينفّذ الأوامر ولا يوفّر النسخ تلقائيًا. زوّد actions بأي عقدة React، مثل زر أو رابط أو حالة. يستخدم نص الأمر دلالات pre وcode، ويحافظ على فواصل الأسطر، ويلتف ضمن العرض المتاح. علامات الموجّه زخرفية.

استخدام

تستهدف السمات الأصلية، ومعالجات الأحداث، والفئات، والأنماط، والمراجع عنصر div الخارجي. استخدم render لتكوين جذر آخر، على سبيل المثال render={<section aria-label="Installation commands" />}. يتم تصدير CommandBlockProps من twenty-ui/components/data-display. عند الترحيل، استبدل button بـ actions.

الخصائص

ReactNode
Content beside the command lines, such as a copy button, link or status.
readonly string[]
مطلوب
Command lines to display. The component prefixes each line with > and does not execute commands.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.