Draws the component with Liquid Glass. Only iOS draws it today, and only when SeedProvider has
supportsLiquidGlass. true equals {}, false turns off the effect from SeedProvider, and omitting it
inherits that effect.
label은 필수이며 기본 접근성 이름으로도 사용됩니다. extended의 기본값은 true입니다.
import IconPlusLine from "@karrotmarket/lynx-monochrome-icon/IconPlusLine";import { FloatingActionButton } from "@/components/ui/floating-action-button";function handleTap() { "background only"; // 새 글 작성 동작을 처리합니다.}export function NewPostButton() { return ( <FloatingActionButton icon={<IconPlusLine />} label="새 글 작성" bindtap={handleTap} /> );}
extended={false}이면 label은 화면에서 숨겨지고 56×56px 아이콘 버튼으로 표시됩니다. 이때도 label은 Root의 접근성 이름으로 남습니다. 다른 설명이 필요하면 accessibility-label을 직접 지정하세요.
glassEffect로 iOS Liquid Glass를 적용합니다. style은 glass 재질("regular"·"clear")을, interactive는 glass가 터치에 직접 반응할지를 정합니다. glass일 때는 현재 상태의 배경색이 glass tint가 되고, 그림자를 그리지 않습니다.
Lynx 예제를 불러오는 중입니다.
import IconPlusLine from "@karrotmarket/lynx-monochrome-icon/IconPlusLine";import { useState } from "@lynx-js/react";import { SeedProvider, VStack } from "@seed-design/lynx-react";import { FloatingActionButton } from "@/components/ui/floating-action-button";import { Switch } from "@/components/ui/switch";// 이 예제만 호스트 지원 여부를 직접 판단합니다. 앱에서는 root `SeedProvider`에 호스트가 준 값을 넘기세요.const supportsLiquidGlass = typeof SystemInfo !== "undefined" && SystemInfo.platform === "iOS" && Number.parseInt(SystemInfo.osVersion, 10) >= 26;export default function Example() { const [clear, setClear] = useState(false); const [interactive, setInteractive] = useState(true); function handleClearChange(checked: boolean) { "background only"; setClear(checked); } function handleInteractiveChange(checked: boolean) { "background only"; setInteractive(checked); } return ( <SeedProvider supportsLiquidGlass={supportsLiquidGlass}> <VStack align="center" gap="x6"> <FloatingActionButton icon={<IconPlusLine />} label="Glass" glassEffect={{ style: clear ? "clear" : "regular", interactive }} /> <VStack gap="x3"> <Switch size="16" tone="neutral" label="Clear style" checked={clear} onCheckedChange={handleClearChange} /> <Switch size="16" tone="neutral" label="Interactive" checked={interactive} onCheckedChange={handleInteractiveChange} /> </VStack> </VStack> </SeedProvider> );}
Liquid Glass는 실험적인 구현입니다. 앱 root SeedProvider에 supportsLiquidGlass를 넘겨야 활성화되며, 지금은 iOS 26 이상에서만 그립니다. 활성화 방법과 제약은 Host Integration을 참고하세요. 이 예제는 미리보기를 위해 예제 안에서만 supportsLiquidGlass를 켭니다.