my-animated-components 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +14 -60
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-animated-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
package/readme.md CHANGED
@@ -1,66 +1,20 @@
1
- # data-paginate
2
- this is pagination hook with array of data
1
+ # Animated Components
3
2
 
4
- import React from 'react';
5
- import { usePagination } from 'data-paginate';
3
+ **Animated Components** is a collection of customizable React components built with Framer Motion for smooth animations. It provides buttons and icon buttons with different styles, sizes, and interactive animations.
6
4
 
7
- const data = [
8
- { id: 1, name: 'Item 1' },
9
- { id: 2, name: 'Item 2' },
10
- // Add more items as needed
11
- ];
5
+ ---
12
6
 
13
- function MyComponent() {
14
- const limit = 10; // Number of items per page
15
- const { paginatedData, page, totalPages, nextPage, prevPage, goToPage } = usePagination(data, limit);
7
+ ## Features
16
8
 
17
- return (
18
- <div>
19
- <ul>
20
- {paginatedData.map((item) => (
21
- <li key={item.id}>{item.name}</li>
22
- ))}
23
- </ul>
24
- <div>
25
- <button onClick={prevPage} disabled={page === 1}>
26
- Previous
27
- </button>
28
- <span>
29
- Page {page} of {totalPages}
30
- </span>
31
- <button onClick={nextPage} disabled={page === totalPages}>
32
- Next
33
- </button>
34
- </div>
35
- <div>
36
- {Array.from({ length: totalPages }, (_, index) => (
37
- <button key={index + 1} onClick={() => goToPage(index + 1)}>
38
- {index + 1}
39
- </button>
40
- ))}
41
- </div>
42
- </div>
43
- );
44
- }
9
+ - **Customizable Buttons**: Supports different variants (`solid`, `outline`, `ghost`) and colors (`primary`, `secondary`).
10
+ - **Icon Button**: Use any custom icon inside the button.
11
+ - **Framer Motion Animations**: Interactive hover and tap animations to enhance user experience.
45
12
 
46
- export default MyComponent;
13
+ ---
47
14
 
48
- # Props
49
- PaginatedComponent Props
50
- paginatedData: Array of items to display on the current page.
51
- page: Current page number.
52
- totalPages: Total number of pages.
53
- onNextPage: Function to handle next page navigation.
54
- onPrevPage: Function to handle previous page navigation.
55
- onGoToPage: Function to handle navigating to a specific page.
56
- usePagination Hook Parameters
57
- data: Array of items to paginate.
58
- limit: Number of items per page.
59
- initialPage: Initial page number (default: 1).
60
- usePagination Hook Return Value
61
- paginatedData: Array of items for the current page.
62
- page: Current page number.
63
- totalPages: Total number of pages.
64
- nextPage: Function to navigate to the next page.
65
- prevPage: Function to navigate to the previous page.
66
- goToPage: Function to navigate to a specific page.
15
+ ## Installation
16
+
17
+ To install **my-animated-components** in your React project, run the following command:
18
+
19
+ ```bash
20
+ npm install my-animated-components