For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/ui/components/button.md.
lynx-ui logo
lynx-ui
  • English
  • Button

    A headless Button component for ReactLynx. It provides press state tracking (`active`) and render props for custom styling.
    Info

    You can check the source code to understand how it works, and you're welcome to submit MRs to enhance its capabilities.

    Basic Usage

    Structure

    <Button>
      {/* Your content */}
    </Button>

    Component API

    Button

    The root component of the Button, containing all of its child components.

    buttonPropsiOSAndroidHarmony
    TypeViewProps
    Button supports original view props to be directly spread in this prop.
    classNameiOSAndroidHarmony
    Typestring
    className
    disablediOSAndroidHarmony
    Typeboolean·Defaultfalse
    Determines whether the button is disabled.
    onClickiOSAndroidHarmony
    Type() => void
    Triggered when the button is clicked.
    styleiOSAndroidHarmony
    TypeCSSProperties
    style
    childreniOSAndroidHarmony
    Type| ReactNode | ((state: {active: boolean, disabled: boolean}) => ReactNode)
    children

    State-based styling & rendering

    This component exposes runtime states through one or both of the following channels. The table lists only the channels available for each state:

    • UI variant class — when supported, a class like ui-<state> is toggled on the corresponding component node for selectors such as .ui-<state> { ... }.
    • Render-prop field — when supported and children is a function, the state is passed in via children({ <state>: boolean, ... }) for runtime-driven rendering.

    UI variants applied by Button based on its render state.

    Class NameRender PropTypeDescription
    ui-activeactivebooleanWhether the button is currently being pressed (and not disabled). Applied when `status.active` is true.
    ui-disableddisabledbooleanWhether the button is disabled. Applied when `status.disabled` is true.
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.