Skip to content

Commit

Permalink
Add story
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Feb 10, 2024
1 parent e8ff58d commit 2c3fd1c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/core/src/docs/examples/scroll-offset.stories.tsx
@@ -0,0 +1,49 @@
import React from "react";
import { DataEditorAll as DataEditor } from "../../data-editor-all.js";
import {
BeautifulWrapper,
Description,
PropName,
useMockDataGenerator,
defaultProps,
} from "../../data-editor/stories/utils.js";
import { SimpleThemeWrapper } from "../../stories/story-utils.js";
import _ from "lodash";

export default {
title: "Glide-Data-Grid/DataEditor Demos",

decorators: [
(Story: React.ComponentType) => (
<SimpleThemeWrapper>
<BeautifulWrapper
title="Scroll Offset"
description={
<Description>
The <PropName>rowGrouping</PropName> prop can be used to group and even fold rows.
</Description>
}>
<Story />
</BeautifulWrapper>
</SimpleThemeWrapper>
),
],
};

export const ScrollOffset: React.VFC<any> = () => {
const { cols, getCellContent } = useMockDataGenerator(100);
const rows = 1000;

return (
<DataEditor
{...defaultProps}
height="100%"
rowMarkers="both"
scrollOffsetY={400}
getCellContent={getCellContent}
columns={cols}
// verticalBorder={false}
rows={rows}
/>
);
};

0 comments on commit 2c3fd1c

Please sign in to comment.