UNPKG

@postenbring/hedwig-react

Version:

React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).

41 lines 1.09 kB
type Variant = { variant?: "show-more"; expanded?: never; } | { variant: "show-more-show-less"; expanded: boolean; }; export type ShowMoreProps = React.HTMLAttributes<HTMLButtonElement> & { text: React.ReactNode; } & Variant; /** * Simple button for triggering more content. * * You have to add the logic for what happens when the button is clicked yourself. * * @example * ```tsx * function Content() { * const [items, fetchMoreItems, moreItemsAvailable] = useYourData(); * function onShowMoreItems() { * fetchMoreItems(); * } * return ( * <> * <ul> * {items.map((item) => ( * <li key={item.id}>{item.text}</li> * ))} * </ul> * {moreItemsAvailable ? * <ShowMoreButton className="mt-8" onClick={onShowMoreItems} lang="en" /> : * null * } * </> * ) * } * ``` */ export declare const ShowMoreButton: import("react").ForwardRefExoticComponent<ShowMoreProps & import("react").RefAttributes<HTMLButtonElement>>; export {}; //# sourceMappingURL=show-more.d.ts.map