--- title: API عناصر ranui description: 'همهٔ عناصر سفارشی ranui — 43 عنصر همراه با ویژگی‌ها، خصیصه‌ها، رویدادها، اسلات‌ها و نام‌های ()::part، همگی استخراج‌شده از کد منبع.' --- # API عناصر ranui (تولید خودکار) این صفحه را `pnpm -F ranui doc:api` از کد منبع کامپوننت‌ها می‌سازد، بنابراین هرگز از آنچه منتشر می‌شود جدا نمی‌افتد. برای هر عنصر: ویژگی‌ها، خصیصه‌های تایپ‌شده، رویدادها (همراه با ساختار `detail` و گزینه‌های ارسال)، اسلات‌ها و نام‌های `()::part`. توضیح‌ها مستقیم از JSDoc کد برداشته می‌شوند و به همین دلیل انگلیسی می‌مانند. متغیرهای CSS هر عنصر در [style-tokens-public.md](https://github.com/chaxus/ran/blob/main/packages/ranui/docs/style-tokens-public.md) آمده است؛ برای انتخاب میان آن‌ها [سیستم طراحی](/fa/src/design/design-system/) و [راهنمای طراحی](/fa/src/design/design-guides/) را ببینید. شیوهٔ استفاده از هر عنصر در صفحهٔ خودش در نوار کناری است؛ اینجا کل سطح رابط یک‌جا آمده. برای هر رویداد گزینه‌های ارسال آن نوشته شده است: `bubbles` (حباب‌کردن)، `composed` (عبور از مرز Shadow) و `cancelable` (امکان وتو با `preventDefault()`). **`element-only`** یعنی هیچ‌کدام از این سه — شنوندهٔ واگذارشده روی یک گره والد هرگز آن را نمی‌بیند، پس شنونده را به خود عنصر ببندید. **43 عنصر سفارشی.** ## `` کد منبع: `components/attachments/index.ts` - **ویژگی‌ها (attribute)**: `sheet: string` - **خصیصه‌ها (property)**: - `accept: string` — Comma-separated types or extensions, in the form `` takes. - `attachments: readonly Attachment[]` — The staged files, in the order they arrived. - `files: File[]` — Just the files, for building a request body. - `maxCount: number` — Most files that may be staged at once; unlimited when unset. - `maxSize: number` — Largest file accepted, in bytes. - `sheet: string` - **رویدادها**: - `attachmentrejected` · bubbles, composed · detail `{ file, reason }` - `attachmentschange` · bubbles, composed · detail `{ attachments }` - **اسلات‌ها**: — - **Part‌ها**: `attachment`, `icon`, `list`, `name`, `remove`, `size`, `thumb` ## `` کد منبع: `components/button/index.ts` - **ویژگی‌ها (attribute)**: `aria-label`, `disabled: boolean | string`, `effect: boolean`, `icon: string`, `iconSize: string`, `sheet: string`, `surface: string`, `type: string` - **خصیصه‌ها (property)**: - `disabled: boolean | string` — Blocks clicks and keyboard activation and removes the button from the tab order. Off by default; `disabled="false"` counts as enabled. - `effect: boolean` — Whether the click ripple is drawn. On by default; opt out with `effect="false"`. - `icon: string` — Name of an `` drawn before the label, for example `'search'`. No icon when empty. - `iconSize: string` — Icon size passed to the inner ``. Defaults to about 1.15× the button's font size; set it only when the icon needs a fixed size. - `sheet: string` - `surface: string` — Surface language for this control (`glass` | `solid`). Paint is CSS-only via - `type: string` — Visual variant: `''` (default) | `'primary'` (monochrome) | `'warning'` | `'text'`. Drives the `:host([type=...])` styles. - **رویدادها**: — - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: `button`, `content` ## `` کد منبع: `components/card/index.ts` - **ویژگی‌ها (attribute)**: `description: string`, `heading: string`, `hoverable: boolean`, `sheet: string`, `surface: string` - **خصیصه‌ها (property)**: - `description: string` — Secondary text shown under the heading. Empty by default; the header is hidden when the heading, description and `extra` slot are all empty. - `heading: string` — Heading text. - `hoverable: boolean` — Interactive card (Geist): hover darkens the border one step. Purely presentational — gate it to cards that are actually clickable. - `sheet: string` - `surface: string` — Surface language for this control (`glass` | `solid`). Paint is CSS-only via - **رویدادها**: — - **اسلات‌ها**: `پیش‌فرض`, `extra (نام‌دار)`, `footer (نام‌دار)` - **Part‌ها**: `body`, `card`, `description`, `extra`, `footer`, `header`, `title` ## `` کد منبع: `components/checkbox/index.ts` - **ویژگی‌ها (attribute)**: `checked: boolean`, `disabled: boolean`, `required: boolean`, `sheet: string`, `value: string` - **خصیصه‌ها (property)**: `checked: boolean`, `disabled: boolean`, `required: boolean`, `sheet: string`, `validationMessage: string`, `validity: ValidityState | undefined`, `value: string` - **رویدادها**: - `change` · element-only · detail `{ checked }` - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: `checkbox`, `inner`, `input`, `label`, `wrapper` ## `` کد منبع: `components/colorpicker/index.ts` - **ویژگی‌ها (attribute)**: `alpha-label`, `disabled: boolean`, `hue-label`, `label: string`, `sheet: string`, `value: string` - **خصیصه‌ها (property)**: - `alphaLabel: string` — Accessible name of the opacity slider. - `disabled: boolean` — Blocks opening the picker and emitting `change`, and removes the swatch from the tab order. Off by default; `disabled="false"` counts as enabled. - `hueLabel: string` — Accessible name of the hue slider. - `label: string` — Accessible name of the swatch that opens the picker. Defaults to `'Choose color'`. - `sheet: string` - `value: string` — Selected colour as `#rrggbb` (or `#rgb`), `rgb(...)` or `rgba(...)`; picking a colour writes a hex value, or `rgba(...)` when opacity is below 1. Unparseable values are ignored. Empty until set; the swatch starts white. - **رویدادها**: - `change` · bubbles, composed - **اسلات‌ها**: — - **Part‌ها**: `block`, `swatch` ## `` کد منبع: `components/popover/content/index.ts` - **ویژگی‌ها (attribute)**: — - **خصیصه‌ها (property)**: — - **رویدادها**: - `change` · element-only - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: — ## `` کد منبع: `components/conversation/index.ts` - **ویژگی‌ها (attribute)**: `empty: string`, `follow: boolean`, `loading-older`, `older: string`, `sheet: string` - **خصیصه‌ها (property)**: - `empty: string` — Text shown while the projection has produced no rows. - `follow: boolean` — Whether new content is followed until the reader scrolls away from the floor. - `loadingOlder: boolean` — Whether a page is in flight; the affordance stays visible and goes inert. - `older: string` — Label for the paging affordance above the first row. Empty hides it. - `pinned: boolean` — Whether the view is currently following new content. - `sheet: string` - **رویدادها**: - `olderrequest` · bubbles, composed - `pinnedchange` · bubbles, composed · detail `{ pinned }` - **اسلات‌ها**: `footer (نام‌دار)` - **Part‌ها**: `conversation`, `empty`, `footer`, `list`, `older` ## `` کد منبع: `components/disclosure-row/index.ts` - **ویژگی‌ها (attribute)**: `busy: boolean`, `expandable: boolean`, `heading: string`, `name: string`, `open: boolean`, `sheet: string`, `summary: string`, `tone: string` - **خصیصه‌ها (property)**: - `busy: boolean` — Whether the work this row stands for is still running. - `expandable: boolean` — Whether the row has a body worth opening. - `heading: string` — The fixed-width left half of the line. - `name: string` — Groups rows so that opening one closes the rest. - `open: boolean` — Whether the body is shown. - `sheet: string` - `summary: string` — The truncating right half. Empty drops the separator with it. - `tone: string` — `error` colours the summary; anything else is the ordinary tone. - **رویدادها**: - `disclosurebeforetoggle` · bubbles, composed, cancelable · detail `{ open }` - `disclosuretoggle` · bubbles, composed · detail `{ open }` - **اسلات‌ها**: `پیش‌فرض`, `leading (نام‌دار)` - **Part‌ها**: `body`, `disclosure`, `leading`, `row`, `separator`, `summary`, `title` ## `` کد منبع: `components/dropdown/index.ts` - **ویژگی‌ها (attribute)**: `arrow: string`, `sheet: string`, `surface: string`, `transit: string` - **خصیصه‌ها (property)**: - `arrow: string` - `sheet: string` - `surface: string` — Surface language for this panel (`glass` | `solid`). Paint is CSS-only via - `transit: string` - **رویدادها**: — - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: `dropdown` ## `` کد منبع: `components/select/dropdown-item/index.ts` - **ویژگی‌ها (attribute)**: `active: string`, `selected: boolean`, `sheet: string`, `title: string`, `value: string` - **خصیصه‌ها (property)**: - `active: string` — The transient cursor that pointer hover and arrow keys move; r-select sets it. It shares the hover fill and carries no selection meaning. - `selected: boolean` — Marks the committed choice with a check mark. Unlike `active` (the transient cursor), it stays put while the cursor moves. - `sheet: string` - `title: string` - `value: string` - **رویدادها**: — - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: `content`, `item` ## `` کد منبع: `components/fan-gallery/index.ts` - **ویژگی‌ها (attribute)**: `sheet: string`, `spread: string` - **خصیصه‌ها (property)**: - `sheet: string` - `spread: string` — Angle in degrees between the first and last child once open. Defaults to `24`; `0` lines them up. - **رویدادها**: — - **اسلات‌ها**: `پیش‌فرض` - **Part‌ها**: `stage` ## `` کد منبع: `components/glass/index.ts` - **ویژگی‌ها (attribute)**: `backdrop: string`, `bevel: string`, `blur`, `dispersion: string`, `displace: string`, `interactive: boolean`, `material: string`, `radius: string`, `rim: boolean`, `saturate: string`, `specular: string`, `tint: string`, `tone: string` - **خصیصه‌ها (property)**: - `backdrop: string` — An `` or `