# Reaction Button URL: /lynx/components/reaction-button Source: https://github.com/daangn/seed-design/blob/dev/docs/content/lynx/components/reaction-button.mdx A component that allows users to express reactions to content. Used to easily provide emotional feedback such as likes and interests. Lynx Engine 최소 버전: 3.6 사용 가능 버전: @seed-design/lynx-react@0.6.0, @seed-design/lynx-css@0.10.0 ## Installation - npm: npm install @seed-design/lynx-react @seed-design/lynx-css - pnpm: pnpm add @seed-design/lynx-react @seed-design/lynx-css - yarn: yarn add @seed-design/lynx-react @seed-design/lynx-css - bun: bun add @seed-design/lynx-react @seed-design/lynx-css Lynx `ReactionButton` is provided directly from the `@seed-design/lynx-react` package without a separate `ui:reaction-button` snippet. ## Usage ## Preview ```tsx import "./styles"; import IconBellFill from "@karrotmarket/lynx-monochrome-icon/IconBellFill"; import { Count, PrefixIcon, ReactionButton, useSeedClassName } from "@seed-design/lynx-react"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( } /> 도움돼요 1 ); } ``` ## Props ## Examples ### Small ```tsx import "./styles"; import IconBellFill from "@karrotmarket/lynx-monochrome-icon/IconBellFill"; import { Count, PrefixIcon, ReactionButton, useSeedClassName } from "@seed-design/lynx-react"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( } /> 도움돼요 1 ); } ``` ### Xsmall ```tsx import "./styles"; import IconBellFill from "@karrotmarket/lynx-monochrome-icon/IconBellFill"; import { Count, PrefixIcon, ReactionButton, useSeedClassName } from "@seed-design/lynx-react"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( } /> 도움돼요 1 ); } ``` ### Disabled ```tsx import "./styles"; import IconBellFill from "@karrotmarket/lynx-monochrome-icon/IconBellFill"; import { PrefixIcon, ReactionButton, useSeedClassName } from "@seed-design/lynx-react"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); return ( } /> 비활성 ); } ``` ### Loading ```tsx import "./styles"; import IconBellFill from "@karrotmarket/lynx-monochrome-icon/IconBellFill"; import { useState } from "@lynx-js/react"; import { PrefixIcon, ReactionButton, useSeedClassName } from "@seed-design/lynx-react"; export default function Example() { const seedClassName = useSeedClassName({ colorMode: "system" }); const [{ pressed, loading }, setState] = useState({ pressed: false, loading: false, }); function handleToggle() { "background only"; setState((previous) => ({ pressed: previous.pressed, loading: true })); setTimeout(() => { setState((previous) => ({ pressed: !previous.pressed, loading: false })); }, 2000); } return ( } /> 시간이 걸리는 토글 ); } ``` Even during loading, `bindtap` and `onPressedChange` still work. If you need to block events, use `disabled` together with loading. ## Web Version Differences Lynx `ReactionButton` has the following differences from React `ReactionButton`: - **Event Handling**: Uses `bindtap` instead of `onClick`. - **Rendering Elements**: Renders native `` and `` elements instead of HTML `