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

Text area

ช่องกรอกข้อความหลายบรรทัด เช่น หมายเหตุ คำอธิบาย หรือเหตุผล มี label, helper text และบรรทัด error เหมือน text input และเพิ่มตัวนับตัวอักษรหรือนับคำ กับช่องที่ขยายตามข้อความได้

HTMLReactReact + Tailwind<ui-text-area label="หมายเหตุ" name="notes" helper-text="สิ่งที่ฝ่ายกฎหมายควรรู้"></ui-text-area> <UiTextArea label="หมายเหตุ" name="notes" helperText="สิ่งที่ฝ่ายกฎหมายควรรู้" /> <TextArea label="หมายเหตุ" name="notes" helperText="สิ่งที่ฝ่ายกฎหมายควรรู้" />

ติดตั้ง

npmshadcn · Web componentshadcn · React + Tailwindคัดลอกเองnpm install @purpurabog/ui npx shadcn@4 add @kanok-ui/text-area npx shadcn@4 add @kanok-ui/tw-text-area # Web component # 1. ติดตั้ง dependency npm install lit@^3.3.0 # 2. คัดลอก "content" ของแต่ละไฟล์จาก # https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/text-area.json # ไปไว้ที่ target ของมัน: # components/ui/primitives/text-area/text-area-skeleton.ts # components/ui/primitives/text-area/text-area.ts # 3. ทำแบบเดียวกันกับ item ที่มันใช้ (registry/<name>.json): # core-auto-grow, core-field, shared-element, shared-field, shared-form-control, shared-localize, shared-skeleton, shared-slots, tokens # React + Tailwind # 1. ติดตั้ง dependency npm install class-variance-authority@0.7.1 @purpurabog/ui@^2.3.0 # 2. คัดลอก "content" ของแต่ละไฟล์จาก # https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/tw-text-area.json # ไปไว้ที่ target ของมัน: # components/ui/react-tw/text-area.tsx # 3. ทำแบบเดียวกันกับ item ที่มันใช้ (registry/<name>.json): # core-field, tw-field, tw-skeleton, tw-theme, tw-utils

npm ให้ทุก component จากแพ็กเกจ ส่วน shadcn คัดลอกซอร์สเข้าแอปของคุณแทน เป็นสำเนาที่ล็อกเวอร์ชันนี้และแก้เองได้ คำสั่ง shadcn ต้องตั้ง registry @kanok-ui ใน components.json ครั้งเดียวก่อน ดู ติดตั้ง

วิธีใช้

HTMLReactReact + Tailwind<script type="module">import '@purpurabog/ui/text-area';</script> <ui-text-area label="หมายเหตุ" name="notes"></ui-text-area> import { UiTextArea } from '@purpurabog/ui/react'; <UiTextArea label="หมายเหตุ" name="notes" onInput={(e) => setNotes((e.target as HTMLTextAreaElement).value)} /> import { TextArea } from '@/components/ui/react-tw/text-area'; <TextArea label="หมายเหตุ" name="notes" value={notes} onChange={(e) => setNotes(e.target.value)} />
  • element ยิง event input แบบ native ทุกครั้งที่พิมพ์ และ change เมื่อผู้ใช้ออกจากช่อง wrapper ของ React จึงมี onInput กับ onChange ส่วน onChange ของ React + Tailwind เป็นของ React เอง (ยิงทุกครั้งที่พิมพ์)

ความสูง

rows กำหนดความสูงเริ่มต้นเป็นจำนวนบรรทัด ค่าเริ่มต้นคือ 4 แบบ Carbon ผู้ใช้ลากมุมช่องให้สูงขึ้นได้ (resize: vertical) ช่องที่ปิดใช้งานจะย่อขยายไม่ได้

HTMLReactReact + Tailwind<ui-text-area label="เหตุผลที่แก้ไข" name="reason" rows="2"></ui-text-area> <UiTextArea label="เหตุผลที่แก้ไข" name="reason" rows={2} /> <TextArea label="เหตุผลที่แก้ไข" name="reason" rows={2} />

ขยายตามข้อความ

auto-grow เริ่มที่ rows แล้วสูงขึ้นทีละบรรทัดตามที่ผู้ใช้พิมพ์ และไม่มีมุมสำหรับลาก max-rows จำกัดความสูงสูงสุด เกินจากนั้นช่องจะเลื่อนดูได้ Carbon ไม่มี auto-grow

HTMLReactReact + Tailwind<ui-text-area label="รายละเอียด" name="description" rows="2" auto-grow max-rows="6"></ui-text-area> <UiTextArea label="รายละเอียด" name="description" rows={2} autoGrow maxRows={6} /> <TextArea label="รายละเอียด" name="description" rows={2} autoGrow maxRows={6} />

นับตัวอักษรหรือนับคำ

max-count แสดงตัวนับไว้เหนือช่อง เป็นขีดจำกัดแบบไม่บังคับเหมือน text input: ถ้าเกิน ตัวนับจะเป็นสีแดง error ขึ้นทันที และฟอร์มส่งไม่ได้ แต่ไม่มีข้อความไหนถูกตัดทิ้ง screen reader จะอ่านเตือนเมื่อใกล้ครบ

counter-mode="word" นับเป็นคำแทน (counterMode ของ Carbon) ภาษาไทยไม่เว้นวรรคระหว่างคำ ช่องจึงใช้ตัวตัดคำของเบราว์เซอร์ตามภาษาของช่อง (lang ที่ช่องหรือที่หน้า): "สวัสดีครับ ผมชื่อสมชาย" นับได้ 5 คำ ส่วนวิธีนับของ Carbon จะตัดคำไทยทุกครั้งที่เจอสระหรือวรรณยุกต์ ตัวเลขไม่นับเป็นคำ

HTMLReactReact + Tailwind<ui-text-area label="หมายเหตุ" name="notes" max-count="200"></ui-text-area> <ui-text-area label="สรุป" name="summary" max-count="50" counter-mode="word" value="สวัสดีครับ ผมชื่อสมชาย"></ui-text-area> <UiTextArea label="หมายเหตุ" name="notes" maxCount={200} /> <UiTextArea label="สรุป" name="summary" maxCount={50} counterMode="word" value="สวัสดีครับ ผมชื่อสมชาย" /> <TextArea label="หมายเหตุ" name="notes" maxCount={200} /> <TextArea label="สรุป" name="summary" maxCount={50} counterMode="word" defaultValue="สวัสดีครับ ผมชื่อสมชาย" />

เปลี่ยนข้อความได้ด้วย too-long-text ({max} จะถูกแทนด้วยจำนวนที่กำหนด) และ near-limit-text ถ้าต้องการขีดจำกัดที่พิมพ์เกินไม่ได้เลย ให้ใช้ maxlength รายละเอียดเพิ่มเติมที่ ฟอร์มและการตรวจค่า

เขียนข้อความของตัวนับเอง

too-long-text คือ error เมื่อข้อความเกินจำนวนที่กำหนด ส่วน near-limit-text คือข้อความที่ screen reader อ่านครั้งเดียวเมื่อเหลือไม่เกิน 10% เขียนให้เข้ากับช่อง ผู้ใช้จะได้รู้ว่าต้องตัดอะไร ข้อความในตัวอย่างนี้ยาวเกินอยู่แล้ว error จึงขึ้นทันที

HTMLReactReact + Tailwind<ui-text-area label="เหตุผลที่ไม่อนุมัติ" name="rejectReason" rows="2" max-count="50" too-long-text="เหตุผลต้องไม่เกิน {max} ตัวอักษร เพื่อให้พอดีกับอีเมลแจ้งผล" near-limit-text="ใกล้ครบความยาวที่อีเมลแจ้งผลรับได้แล้ว" value="ค่าเช่าสูงกว่างบประมาณที่ฝ่ายการเงินอนุมัติไว้สำหรับปีนี้ และยังไม่รวมค่าส่วนกลาง"></ui-text-area> <UiTextArea label="เหตุผลที่ไม่อนุมัติ" name="rejectReason" rows={2} maxCount={50} tooLongText="เหตุผลต้องไม่เกิน {max} ตัวอักษร เพื่อให้พอดีกับอีเมลแจ้งผล" nearLimitText="ใกล้ครบความยาวที่อีเมลแจ้งผลรับได้แล้ว" /> <TextArea label="เหตุผลที่ไม่อนุมัติ" name="rejectReason" rows={2} maxCount={50} tooLongText="เหตุผลต้องไม่เกิน {max} ตัวอักษร เพื่อให้พอดีกับอีเมลแจ้งผล" nearLimitText="ใกล้ครบความยาวที่อีเมลแจ้งผลรับได้แล้ว" />

ข้อความช่วย คำเตือน และ error

เหมือน text input: ใต้ช่องแสดงได้ทีละบรรทัด error มาก่อนคำเตือน และคำเตือนมาก่อน helper text ไอคอน error และคำเตือนอยู่ที่มุมขวาบนของช่อง

HTMLReactReact + Tailwind<ui-text-area label="ที่อยู่จัดส่ง" name="address" value="99/1 ถนนพระรามสี่" warn warn-text="เพิ่มเขตและรหัสไปรษณีย์"></ui-text-area> <ui-text-area label="เหตุผล" name="reason" invalid invalid-text="บอกเหตุผลที่ยกเลิกสัญญาก่อนกำหนด"></ui-text-area> <UiTextArea label="ที่อยู่จัดส่ง" name="address" value="99/1 ถนนพระรามสี่" warn warnText="เพิ่มเขตและรหัสไปรษณีย์" /> <UiTextArea label="เหตุผล" name="reason" invalid invalidText="บอกเหตุผลที่ยกเลิกสัญญาก่อนกำหนด" /> <TextArea label="ที่อยู่จัดส่ง" name="address" defaultValue="99/1 ถนนพระรามสี่" warn warnText="เพิ่มเขตและรหัสไปรษณีย์" /> <TextArea label="เหตุผล" name="reason" invalid invalidText="บอกเหตุผลที่ยกเลิกสัญญาก่อนกำหนด" />

ใน element required, minlength และ maxlength ทำงานเหมือน <textarea> ส่วนใน React + Tailwind การตรวจค่าเป็นหน้าที่ของแอป ให้ส่ง invalid และ invalidText มา เรื่องอื่น ๆ ของ error ดูที่ ฟอร์มและการตรวจค่า

label และข้อความช่วยที่มี markup

ถ้า label หรือข้อความมี markup ให้ใช้ slot label และ helper-text (warn-text กับ invalid-text ก็ใช้แบบเดียวกัน) ช่องของ React + Tailwind รับ markup ทาง label และ helperText

ขอบเขตงาน (เป็นส่วนหนึ่งของสัญญา) เขียนบริการแต่ละอย่างบรรทัดละหนึ่งรายการ
HTMLReactReact + Tailwind<ui-text-area name="scope" rows="3"> <span slot="label">ขอบเขตงาน <em>(เป็นส่วนหนึ่งของสัญญา)</em></span> <span slot="helper-text">เขียนบริการแต่ละอย่าง<strong>บรรทัดละหนึ่งรายการ</strong></span> </ui-text-area> <UiTextArea name="scope" rows={3}> <span slot="label">ขอบเขตงาน <em>(เป็นส่วนหนึ่งของสัญญา)</em></span> <span slot="helper-text">เขียนบริการแต่ละอย่าง<strong>บรรทัดละหนึ่งรายการ</strong></span> </UiTextArea> <TextArea name="scope" rows={3} label={<>ขอบเขตงาน <em>(เป็นส่วนหนึ่งของสัญญา)</em></>} helperText={<>เขียนบริการแต่ละอย่าง<strong>บรรทัดละหนึ่งรายการ</strong></>} />

อ่านอย่างเดียว ปิดใช้งาน และ fluid

  • readonly แสดงข้อความและส่งค่าไปกับฟอร์ม แต่ผู้ใช้แก้ไม่ได้ ส่วน disabled ทำให้ช่องเป็นสีเทาและไม่ส่งค่า
  • fluid หรือการครอบด้วยฟอร์มแบบ fluid ย้าย label เข้าไปในกล่อง (FluidTextArea ของ Carbon ดู ฟอร์มแบบ fluid)
HTMLReactReact + Tailwind<ui-text-area label="เงื่อนไข" value="ชำระค่าเช่าทุกวันทำการแรกของเดือน" readonly></ui-text-area> <ui-text-area label="หมายเหตุจากฝ่ายกฎหมาย" value="ตรวจแล้วเมื่อ 2 ตุลาคม" rows="2" disabled></ui-text-area> <ui-text-area label="หมายเหตุ" name="notes" fluid></ui-text-area> <UiTextArea label="เงื่อนไข" value="ชำระค่าเช่าทุกวันทำการแรกของเดือน" readonly /> <UiTextArea label="หมายเหตุจากฝ่ายกฎหมาย" value="ตรวจแล้วเมื่อ 2 ตุลาคม" rows={2} disabled /> <UiTextArea label="หมายเหตุ" name="notes" fluid /> <TextArea label="เงื่อนไข" defaultValue="ชำระค่าเช่าทุกวันทำการแรกของเดือน" readOnly /> <TextArea label="หมายเหตุจากฝ่ายกฎหมาย" defaultValue="ตรวจแล้วเมื่อ 2 ตุลาคม" rows={2} disabled /> <TextArea label="หมายเหตุ" name="notes" fluid />

แบบมีขอบ (ดีไซน์ Kanok)

ในดีไซน์ Kanok ช่องกรอกเป็นแบบ filled โดยปกติ คือพื้นเทาอ่อน ไม่มีขอบ ใส่ data-field-variant="outlined" ที่ element ที่ครอบช่อง (เช่น <form> หรือ <html> ถ้าต้องการทั้งแอป) จะเปลี่ยนเป็นขอบ 1px บนพื้นใส ส่วน focus ยังเป็นวงแสงสีฟ้าเหมือนเดิม attribute นี้ไม่มีผลในดีไซน์ Carbon ตัวอย่างด้านล่างจึงครอบด้วย data-design="kanok" ดูรายละเอียดทั้งหมดที่ ดีไซน์ Kanok

HTMLReactReact + Tailwind<div data-design="kanok" data-theme="paper" data-field-variant="outlined"> <ui-text-area label="หมายเหตุ" name="notes" helper-text="สิ่งที่ฝ่ายกฎหมายควรรู้"></ui-text-area> </div> <div data-field-variant="outlined"> <UiTextArea label="หมายเหตุ" name="notes" helperText="สิ่งที่ฝ่ายกฎหมายควรรู้" /> </div> <div data-field-variant="outlined"> <TextArea label="หมายเหตุ" name="notes" helperText="สิ่งที่ฝ่ายกฎหมายควรรู้" /> </div>

ตรวจค่าในฟอร์ม

ใน <form> required และ minlength จะไม่ให้ส่งฟอร์มจนกว่าข้อความจะยาวพอ และช่องจะแสดง error ลองส่งฟอร์มนี้ด้วยเหตุผลสั้น ๆ

ส่งขออนุมัติ

ส่งค่า:

HTMLReactReact + Tailwind<form id="text-area-form" method="dialog" style="display: grid; gap: 16px"> <ui-text-area label="เหตุผลที่แก้ไข" name="reason" rows="3" required minlength="20" helper-text="อย่างน้อย 20 ตัวอักษร"></ui-text-area> <div><ui-button type="submit" size="md">ส่งขออนุมัติ</ui-button></div> </form> <p>ส่งค่า: <output id="text-area-form-out"></output></p> <script type="module"> const form = document.getElementById('text-area-form'); form.addEventListener('submit', (event) => { event.preventDefault(); document.getElementById('text-area-form-out').textContent = [...new FormData(form)].map(([key, value]) => `${key}=${value}`).join(', '); }); </script> <form onSubmit={(e) => { e.preventDefault(); sendForApproval(new FormData(e.currentTarget)); }}> <UiTextArea label="เหตุผลที่แก้ไข" name="reason" rows={3} required minlength={20} helperText="อย่างน้อย 20 ตัวอักษร" /> <UiButton type="submit" size="md">ส่งขออนุมัติ</UiButton> </form> // การตรวจของแอปใส่ข้อความลงใน `reasonError` แบบ Carbon React <form onSubmit={(e) => { e.preventDefault(); sendForApproval(new FormData(e.currentTarget)); }} noValidate> <TextArea label="เหตุผลที่แก้ไข" name="reason" rows={3} helperText="อย่างน้อย 20 ตัวอักษร" invalid={!!reasonError} invalidText={reasonError} /> <Button type="submit" size="md">ส่งขออนุมัติ</Button> </form>

บันทึกร่างเมื่อผู้ใช้ออกจากช่อง

change ยิงครั้งเดียวเมื่อผู้ใช้แก้ข้อความแล้วออกจากช่อง จึงเป็นจังหวะที่ดีสำหรับบันทึกร่าง โดยไม่ต้องส่ง request ทุกครั้งที่พิมพ์

ร่าง: ยังไม่ได้บันทึก

HTMLReactReact + Tailwind<ui-text-area id="text-area-draft" label="บันทึกการประชุม" name="minutes" rows="3"></ui-text-area> <p>ร่าง: <output id="text-area-draft-out">ยังไม่ได้บันทึก</output></p> <script type="module"> const minutes = document.getElementById('text-area-draft'); minutes.addEventListener('change', () => { const time = new Date().toLocaleTimeString('th', { hour: '2-digit', minute: '2-digit' }); document.getElementById('text-area-draft-out').textContent = `บันทึกเมื่อ ${time} น. ยาว ${minutes.value.length} ตัวอักษร`; }); </script> <UiTextArea label="บันทึกการประชุม" name="minutes" rows={3} onChange={(e) => saveDraft((e.target as HTMLTextAreaElement).value)} /> // ที่นี่ onChange ยิงทุกครั้งที่พิมพ์: บันทึกเมื่อช่องเสียโฟกัสแทน <TextArea label="บันทึกการประชุม" name="minutes" rows={3} onBlur={(e) => saveDraft(e.target.value)} />

Skeleton

ระหว่างที่ข้อมูลของฟอร์มกำลังโหลด <ui-text-area-skeleton> จองที่ของช่องไว้ เป็นแถบ label กับแถบช่องสูง 100px หรือเป็นกล่องแบบ fluid เมื่อใส่ fluid screen reader ข้ามแถบนี้ จึงต้องบอกว่า "กำลังโหลด" ที่ฟอร์มแทน (เช่น aria-busy="true")

HTMLReactReact + Tailwind<ui-text-area-skeleton></ui-text-area-skeleton> <ui-text-area-skeleton fluid></ui-text-area-skeleton> import { UiTextAreaSkeleton } from '@purpurabog/ui/react'; <UiTextAreaSkeleton /> <UiTextAreaSkeleton fluid /> import { TextAreaSkeleton } from '@/components/ui/react-tw/text-area'; <TextAreaSkeleton /> <TextAreaSkeleton fluid />

Accessibility

  • label เป็น <label> จริงที่ผูกกับ <textarea> ข้างใน และบรรทัดข้อความใต้ช่องเป็น aria-describedby ของมัน aria-label ที่ตัว element ไปไม่ถึง textarea ให้ใช้ label แทน (คู่กับ hide-label ถ้าไม่อยากให้เห็น)
  • Enter ขึ้นบรรทัดใหม่เหมือน text area ทั่วไป ไม่ส่งฟอร์ม
  • ตัวนับไม่ถูกอ่านทุกครั้งที่พิมพ์ screen reader จะอ่านครั้งเดียวเมื่อใกล้ครบ และเมื่อเกินจำนวนที่กำหนด

ต้องการแค่พฤติกรรมโดยไม่มี style: Headless Text area

API

สร้างจากแพ็กเกจโดยตรง ใน React ส่ง property เป็น prop ชื่อเดียวกัน ส่วน event ก็เป็น prop เช่นกัน (ดูคอลัมน์ React)

<ui-text-area> · React UiTextArea

Attribute

Attribute Property ชนิด ค่าเริ่มต้น คำอธิบาย
label label string '' Visible label text; the label slot replaces it when markup is needed.
hide-label hideLabel boolean false Keep the label for screen readers but don't show it.
helper-text helperText string '' Helper text under the field, shown while there is no error or warning.
invalid-text invalidText string '' Error text shown while invalid or while the field fails validation.
invalid invalid boolean false Forces the error state, e.g. after server-side validation.
warn warn boolean false Non-blocking warning; shown when there is no error.
warn-text warnText string '' Text of the warning shown while warn.
value value string ''
name name string '' Reflected: form-associated elements submit under the name attribute.
placeholder placeholder string ''
rows rows number 4 Initial number of text rows (Carbon default 4); the user can still resize.
minlength minlength number | undefined
maxlength maxlength number | undefined
autocomplete autocomplete string '' Passed to the textarea (off, or an autofill token).
inputmode inputmode string '' Passed to the text box: the virtual keyboard to show (numeric, decimal, email, tel, url, search…).
enterkeyhint enterkeyhint string '' Passed to the text box: the label of the virtual keyboard's Enter key (search, send, next, done…).
max-count maxCount number | undefined Soft limit with a visible counter (unlike maxlength, extra text isn't blocked).
counter-mode counterMode CounterMode 'character' What max-count counts: character (default) or word (Carbon counterMode).
auto-grow autoGrow boolean false Grows with the text from rows (no Carbon counterpart); max-rows caps it, then it scrolls.
max-rows maxRows number | undefined The most lines auto-grow shows before scrolling (default: no cap).
too-long-text tooLongText string '' Error when over max-count; {max} is replaced with the limit (default: the translation's, for characters or words).
near-limit-text nearLimitText string '' Announced once when what is left of the limit drops to 10% or less.
disabled disabled boolean false Disables the control; a disabled <fieldset> ancestor does the same.
readonly readonly boolean false Shows and submits the value but blocks changes.
fluid fluid boolean false Carbon FluidTextArea: the label inside a 64px box, an error / warning inside it. <ui-fluid-form> sets it for every field inside.
required required boolean false Blocks form submission while the field is empty.

Property

Property ชนิด คำอธิบาย
willValidate (อ่านอย่างเดียว) Whether the field takes part in constraint validation (not while disabled), as natively.
labels (อ่านอย่างเดียว) The <label>s that point at this field.

Method

Method คำอธิบาย
setCustomValidity(message) Like <input>.setCustomValidity(): a non-empty message makes the field invalid (and is shown as its error once touched) until cleared with ''.

Event

Event React คำอธิบาย
change onChange Re-dispatched from the native textarea (native change is not composed)
input onInput Native input event (already composed, so it reaches the host)

Slot

Slot คำอธิบาย
label Label content with markup; the label attribute is the plain-text fallback
helper-text Helper text with markup (links, bold); overrides helper-text
warn-text Warning text shown while warn; overrides warn-text
invalid-text Error text shown while invalid; overrides invalid-text

CSS part

Part คำอธิบาย
base The field box around the textarea
label The label
input The native textarea
counter The character (or word) counter
status-icon The error / warning icon
helper-text The helper line
warning-text The warning line
warn-text Same line as warning-text (named after the warn-text attribute / slot)
error-text The error line
invalid-text Same line as error-text (named after the invalid-text attribute / slot)

CSS custom property

Custom property ค่าเริ่มต้น คำอธิบาย
--ui-field-border Border on every side of the box (default none: Carbon's underline only; Kanok: a 1px outline)
--ui-field-disabled-border-color Border colour when disabled (default: the underline transparent)
--ui-field-readonly-border-color Border colour when read-only (default: a hairline underline)
--ui-field-radius Corner radius of the box (default 0; Kanok: 6px)
--ui-field-background Fill of the box (default --ui-surface-1; Kanok: transparent)
--ui-label-font Font of the label (default --ui-font-caption; Kanok: 14px semibold)
--ui-label-color Colour of the label (default --ui-ink-muted; Kanok: --ui-ink)
--ui-field-readonly-background The box's fill when read-only (default transparent; Kanok: a faint ink tint, so read-only reads as set and never weaker than disabled)
--ui-fluid-background / --ui-fluid-gap - A fluid box's fill and the space under it (default the layer's fill, 0: boxes that touch; Kanok: transparent, 8px)