Astryx

Astryx Chat Layout Scroll Button

Buttons 3

About

An Astryx floating scroll-to-bottom button that appears when the user moves away from the newest chat messages.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Chat Layout Scroll Button to your project and fits it to your theme.

Code

How Astryx Chat Layout Scroll Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {ChatLayoutScrollButton} from '@/components/ui/astryx-chat-layout-scroll-button';
import {Stack} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';

export default function ChatLayoutScrollButtonStates() {
  return (
    <div
      data-astryx-theme="neutral"
      data-theme="light"
      style={{colorScheme: 'light', display: 'contents'}}>
      <Stack direction="vertical" gap={4}>
        <Stack direction="vertical" gap={1}>
          <Text type="supporting" color="secondary">
            Hidden (user is at bottom)
          </Text>
          <ChatLayoutScrollButton isVisible={false} onClick={() => {}} />
        </Stack>
        <Stack direction="vertical" gap={1}>
          <Text type="supporting" color="secondary">
            Visible (user scrolled up)
          </Text>
          <ChatLayoutScrollButton isVisible={true} onClick={() => {}} />
        </Stack>
        <Stack direction="vertical" gap={1}>
          <Text type="supporting" color="secondary">
            Expanded with label (new messages arrived)
          </Text>
          <ChatLayoutScrollButton
            isVisible={true}
            label="New messages"
            onClick={() => {}}
          />
        </Stack>
      </Stack>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    30
  • Astryx Button Group

    Astryx Button Group

    30
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    14

More in Buttons

View all
  • Button

    Button

    166
  • Button

    Button

    21
  • Texture Button

    Texture Button

    119
  • Figma File Button

    Figma File Button

    39
  • Native Button

    Native Button

    12
  • Button

    Button

    86
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Great UI Button

    Great UI Button

    19