หัวหน้า
PageHeader
The top of a page: a short line saying where it belongs, the page's title as its one level 1 heading, a sentence on what it's for, and the page's actions. Use it once per page, at the top of its content.
ใช้เป็นส่วนบนของหน้า: บรรทัดสั้นบอกว่าหน้าอยู่ส่วนไหน ชื่อหน้าซึ่งเป็นหัวข้อระดับ 1 ประโยคบอกว่าหน้านี้ใช้ทำอะไร และปุ่มหลักของหน้า ใช้หน้าละครั้ง หน้ารายละเอียดของรายการใช้ RecordHeader แทน
import { PageHeader } from "@bsru/ui";ตัวอย่าง
หัวหน้ารายการ
kicker คือกลุ่มเมนู title คือชื่อหน้า และ description บอกว่าหน้านี้มีอะไร
งบประมาณและการเงิน
คำขอซื้อขอจ้าง
คำขอที่คุณสร้างหรือที่รอคุณอนุมัติ เรียงจากล่าสุด
<PageHeader
kicker="งบประมาณและการเงิน"
title="คำขอซื้อขอจ้าง"
description="คำขอที่คุณสร้างหรือที่รอคุณอนุมัติ เรียงจากล่าสุด"
/>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| kicker | "งบประมาณและการเงิน" | string | A short line above the title, such as the system or the menu group. |
| title* จำเป็น | "คำขอซื้อขอจ้าง" | string | The page's title, its level 1 heading. |
| description | "คำขอที่คุณสร้างหรือที่รอคุณอนุมัติ เรียงจากล่าสุด" | string | What the page is for, in a sentence or two. |
พร้อมปุ่มของหน้า
actions วางปุ่มหลักไว้ข้างชื่อหน้าบนจอกว้าง และใต้ชื่อบนมือถือ
งบประมาณและการเงิน
คำขอซื้อขอจ้าง
<PageHeader
kicker="งบประมาณและการเงิน"
title="คำขอซื้อขอจ้าง"
actions={<Button label="สร้างคำขอ" tone="primary" icon={Plus} href="/purchase-requests/new" />}
/>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| kicker | "งบประมาณและการเงิน" | string | A short line above the title, such as the system or the menu group. |
| title* จำเป็น | "คำขอซื้อขอจ้าง" | string | The page's title, its level 1 heading. |
| actions | "<Button />" | ReactNode | The page's main actions, such as Button components, shown beside the title on wide screens. |
props ทั้งหมด
ตัวอย่างด้านบนใช้ props เพียงบางตัว ตารางนี้แสดงทุกตัวที่คอมโพเนนต์รับ พร้อมค่าเริ่มต้นและค่าที่ใช้ได้
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| kicker | string | — | A short line above the title, such as the system or the menu group. |
| title* จำเป็น | string | — | The page's title, its level 1 heading. |
| description | string | — | What the page is for, in a sentence or two. |
| actions | ReactNode | — | The page's main actions, such as Button components, shown beside the title on wide screens. |
ข้อควรปฏิบัติ
- หน้าหนึ่งมีหัวข้อระดับ 1 เดียว คือ title ของ PageHeader
- ข้อความทั้งหมดเป็นข้อความในภาษาของหน้าจอจากไฟล์ข้อความของแอป
ซอร์สโค้ด: ui/src/panel.tsx