--- title: ranui 要素 API description: 'ranui のすべてのカスタム要素 —— 43 個の要素の属性、プロパティ、イベント、スロット、::part() 名。いずれもソースから抽出しています。' --- # ranui 要素 API(自動生成) `pnpm -F ranui doc:api` がコンポーネントのソースから自動生成するため、実際に配布される コードとずれることがありません。要素ごとに属性(attribute)、型つきプロパティ、イベント (`detail` の構造と派発オプションつき)、スロット、`::part()` 名を列挙します。説明は ソースの JSDoc をそのまま取り出したものなので英語のままです。 各要素が公開する CSS 変数は [style-tokens-public.md](https://github.com/chaxus/ran/blob/main/packages/ranui/docs/style-tokens-public.md) を、使い分けは [デザインシステム](/ja/src/design/design-system/)と[デザインガイドライン](/ja/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 `