跳到主要内容

画板

选择画板

每个 Rive 文件(.riv)可以包含多个画板。你可以根据想要的 Rive 文件「片段」或视图在运行时指定要渲染的画板。

export const Simple = () => (
<Rive
src="https://cdn.rive.app/animations/vehicles.riv"
artboard="Truck"
stateMachine="bumpy"
/>
);

// 使用 `useRive` Hook:
export default function Simple() {
const { RiveComponent } = useRive({
src: 'https://cdn.rive.app/animations/vehicles.riv',
artboard: 'Truck',
stateMachine: 'bumpy',
autoplay: true,
});

return <RiveComponent />;
}
看完还有疑问?进群交流下!
与众多 Rive 创作者、开发者一起交流探讨与答疑解惑。
加入交流群