import React from "react"; import { LoremIpsum } from "react-lorem-ipsum"; import { Meta, StoryFn } from "@storybook/react"; import { HtmlContentBlock, StickyTarget } from "../../../../index"; export default { title: "Components/StickyTarget", component: StickyTarget, argTypes: {}, } as Meta; const Template: StoryFn = (args) => (
{args.getConnectedElement && args.to !== "bottom" && (

Top element.

)}

First sticky element.

Sticky element.

Another sticky element.

{args.getConnectedElement && args.to === "bottom" && (

Bottom element.

)}
); export const Default = Template.bind({}); Default.args = { className: "stickytarget-extraclass", "data-test-id": "stickytarget-test-id", "data-testid": "stickytarget-testid", }; export const ConnectedElement = Template.bind({}); ConnectedElement.args = { getConnectedElement: () => { return window.document.getElementById("connected-element") || false; }, };