Docs

API 參考

Slide

承載單頁 native 圖層的完整畫布。

presentation.tsx

<Slide id="slide-01" background="#F7F7F5" canvasWidth={1920} canvasHeight={1080} duration={5} fontSizeUnit="pt" theme="light">
  <Text id="title" x={8} y={8} w={84} h={14}>一個清楚的主張</Text>
</Slide>

屬性參考

屬性值應保持字面且可序列化,才能由 Canvas、Inspector、驗證與匯出流程可靠處理。

API屬性型別/值必要說明
Slideidstring是穩定的投影片識別字。
backgroundcolor string—投影片背景顏色。
backgroundImagestring—本機背景圖片路徑。
backgroundFitcover | contain | fill | scale-down—背景圖片填滿畫布的方式。
canvasWidthnumber—目標畫布寬度,通常為 1920。
canvasHeightnumber—目標畫布高度,通常為 1080。
fontSizeUnit"pt"—設定為 pt 時,Text 與 Table 的字級會以 point 計算。
durationnumber—投影片停留時間,單位為秒。
themestring—簡報主題色調,例如 light 或 dark。
slideTransitionstring—前往下一張的轉場;使用 morph 時必須有相容的 sharedId 配對。
transitionDurationnumber—轉場時間,單位為秒。
morphEasingstring—Morph 轉場的 easing。
morphFadeUnmatchedboolean—Morph 時未配對的圖層是否淡出。
morphShapeSoftnessnumber—相容 Shape Morph 的柔化程度。
morphShapePrecisionnumber—Shape Morph 的取樣精度。
morphCurveX1 / morphCurveY1 / morphCurveX2 / morphCurveY2number—morphEasing 為 custom 時使用的控制點。

常用 props

使用 id、background、canvasWidth、canvasHeight、duration、fontSizeUnit 與 theme 建立投影片。畫布尺寸描述目標畫布,duration 的單位是秒。

內容

Slide 內包含 native 圖層;請保持 frame 數值固定,讓 Canvas 與 Inspector 能夠操作。