Skip to content

Commit 1bd77d4

Browse files
committed
💄 Add Custom pagination example
1 parent 7d46d9f commit 1bd77d4

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

doc/src/components/common/componentData/Pagination/index.js

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const componentData = {
4545
{
4646
prop: 'navigationButtons',
4747
type: 'boolean',
48-
defaultValue: 'false',
48+
defaultValue: 'true',
4949
description: 'Shows navigation buttons when `true`.',
5050
},
5151
],
@@ -83,16 +83,50 @@ export const componentData = {
8383
<Pagination total={10}/>
8484
`,
8585
componentUsage: `
86-
class Demo extends React.Component {
86+
// Component.js
87+
88+
class Demo extends React.Component {
8789
render() {
8890
return (
89-
<div>
91+
<PreviewElements>
9092
<PreviewBlock header="Pagination">
91-
<Pagination total={10}/>
93+
<PreviewElements>
94+
95+
{/* Default Pagination Component */}
96+
<Pagination total={10}/>
97+
98+
</PreviewElements>
9299
</PreviewBlock>
93-
</div>
100+
<PreviewBlock header="Custom Pagination">
101+
<PreviewElements>
102+
103+
{/* Custom themed Pagination Component, Refer theme.scss below */}
104+
<Pagination total={6} theme={componentTheme} navigationButtons={false}/>
105+
106+
</PreviewElements>
107+
</PreviewBlock>
108+
</PreviewElements>
94109
)
95110
}
96111
}
97112
`,
113+
componentUsageTheme: `
114+
// theme.scss
115+
116+
:local(.pagination-steps) {
117+
border-color: transparent;
118+
color: #8047c7;
119+
}
120+
121+
:local(.active) {
122+
color: #ff8600;
123+
}
124+
125+
:local(.dots) {
126+
span {
127+
height: 0.3em;
128+
width: 0.3em;
129+
}
130+
}
131+
`,
98132
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:local(.pagination-steps) {
2+
border-color: transparent;
3+
color: #8047c7;
4+
}
5+
6+
:local(.active) {
7+
color: #ff8600;
8+
}
9+
10+
:local(.dots) {
11+
span {
12+
height: 0.3em;
13+
width: 0.3em;
14+
}
15+
}

doc/src/components/common/componentData/theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@import './Modal/theme.scss';
99
@import './MultiSelect/theme.scss';
1010
@import './Navbar/theme.scss';
11+
@import './Pagination/theme.scss';
1112
@import './Select/theme.scss';
1213
@import './Slider/theme.scss';
1314
@import './TextInput/theme.scss';

0 commit comments

Comments
 (0)