Skip to content

Commit

Permalink
fix(Pagination): updated storybook controls with a playground
Browse files Browse the repository at this point in the history
  • Loading branch information
sstrubberg committed Nov 11, 2022
1 parent 33e47f3 commit 33302de
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/react/src/components/Pagination/Pagination.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Props } from '@storybook/addon-docs';
import { Story, Props, Source, Preview } from '@storybook/addon-docs';
import { Pagination } from '.';

# Pagination

Expand All @@ -10,8 +11,16 @@ import { Props } from '@storybook/addon-docs';

## Table of Contents

- [Overview](#overview)
- [Component API](#component-api)
- [Feedback](#feedback)

## Overview

<Preview>
<Story id="components-pagination--default" />
</Preview>

## Component API

<Props />
Expand Down
23 changes: 22 additions & 1 deletion packages/react/src/components/Pagination/Pagination.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React from 'react';
import { action } from '@storybook/addon-actions';
import mdx from './Pagination.mdx';

import Pagination from './Pagination';

Expand Down Expand Up @@ -35,9 +36,29 @@ export default {
</div>
),
],
parameters: {
docs: {
page: mdx,
},
},
};

export const Default = () => <Pagination {...props()} />;
export const Default = () => (
<Pagination
disabled={false}
page={1}
totalItems={103}
pagesUnknown={false}
pageInputDisabled={undefined}
pageSizeInputDisabled={undefined}
backwardText={'Previous page'}
forwardText={'Next page'}
pageSize={10}
pageSizes={[10, 20, 30, 40, 50]}
itemsPerPageText={'Items per page:'}
onChange={action('onChange')}
/>
);

export const MultiplePaginationComponents = () => {
return (
Expand Down

0 comments on commit 33302de

Please sign in to comment.