ui
ธีม รูปแบบ CarbonKanok ภาษา English
ภาพรวมติดตั้งการย้ายไป 1.0ธีมและ layerดีไซน์ Kanokปรับแต่งหน้าตาไอคอนฟอร์มและการตรวจค่าใช้กับ frameworkใช้กับ AIButtonText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderModalSide panelTearsheetNotificationToastTooltipDefinition tooltipPopoverToggletipMenuData tableStructured listPaginationContained listTree viewTabsBreadcrumbLinkPagination navContent switcherAccordionProgress indicatorUI shellTagTileCardProduct cardCode snippetCopy buttonUser avatarTruncated textListLoadingInline loadingProgress barSkeletonBadge indicatorStatus indicatorGridHeadingLayerAction setPage headerBig numberEdit in placeแนะนำText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderTabsPagination navContent switcherTooltipDefinition tooltipPopoverMenuAccordionProgress indicatorUI shellModalSide panelTearsheetNotificationToastData tableStructured listPaginationTree viewCode snippetCopy buttonTruncated textLoadingTagCardProduct cardEdit in place

@purpurabog/ui

component ตามดีไซน์ Carbon ของ IBM สำหรับงานฟอร์มภาษาไทยและอังกฤษ: ช่องกรอก, รายการเลือก, วันที่ (พ.ศ.), overlay, ตารางข้อมูล และโครงหน้าแอป (UI shell) เว็บนี้ก็สร้างด้วย component ชุดนี้

component ชุดเดียวกันมีให้ใช้ 3 แบบ เลือกตามแอปของคุณ:

แอปของคุณใช้ ใช้แบบ ได้อะไร
framework ไหนก็ได้ หรือ HTML ล้วน Lit web components (<ui-date-picker>) หน้าตาและพฤติกรรมแบบ Carbon แต่งด้วย token และ ::part()
React + Tailwind copy component เข้าแอปด้วย shadcn (npx shadcn add) หน้าตาแบบ Carbon เป็น class ของ Tailwind แก้ได้ทุกบรรทัด
React แต่อยากออกแบบเอง ชิ้นส่วนแบบไม่มี style (@purpurabog/ui/headless) คีย์บอร์ด โฟกัส และ ARIA แบบ Carbon โดยไม่มี class เลย

ทั้งสามแบบใช้แกนเดียวกัน พฤติกรรมจึงเหมือนกันทุกที่ ทุก component ทดสอบเทียบกับ Carbon ใน Chrome และ WebKit พร้อม axe และคีย์บอร์ด

ลองใช้

<ui-date-picker label="วันที่เริ่มสัญญา" helper-text="วว/ดด/ปปปป"></ui-date-picker>

ลองเปลี่ยนธีมหรือภาษาที่ปุ่มตั้งค่ามุมขวาบน component จะเปลี่ยนตาม data-theme และ lang ของหน้า

ต่อไป