From 728d77e80d3305efc36e56b79a30d2cdc78630e1 Mon Sep 17 00:00:00 2001 From: Renato Pozzi Date: Fri, 21 Jan 2022 14:22:33 +0100 Subject: [PATCH] feat: changed readme documentation this is a feat because semantic-release is crazy and does not accept the 1.1.0 ._. --- README.md | 104 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 189f340..fd39f94 100644 --- a/README.md +++ b/README.md @@ -32,52 +32,106 @@ $ yarn add react-plock $ npm install react-plock ``` -The most simple way to use Plock is to import it in your React app: +The simplest way to use Plock is to import it in your React app: ```jsx - - I'm a super component! 😎 - I'm a super component too! 🤓 - Don't forget me! 😏 - +import { Plock } from "react-plock"; + +export function Komponent() { + return ( + +
Sun is shining ☀️
+
Moon is shining 🌙
+
Stars are shining ✨
+
+ ); +} ``` And that's it! 🎉 🎉 🎉 By default, Plock will use the `grid` layout with three columns. You can also override this prop by setting the `nColumns` prop: ```jsx - -
1
-
2
-
3
-
4
-
+import { Plock } from "react-plock"; + +const Tile = ({ children, style, ...rest }) => ( +
+ {children} +
+); + +export function Komponent() { + return ( + + I love Plock! 💙 + I love React! 💛 + I love Javascript! 💝 + Give us a Star! 🌟 + + ); +} +``` + +If you need different breakpoints, you can use pass an array like this: + +```jsx +import { Plock } from "react-plock"; + +export function Komponent() { + const breakpoints = [ + { size: 640, columns: 1 }, + { size: 768, columns: 2 }, + { size: 1024, columns: 3 }, + { size: 1280, columns: 6 }, + ]; + + return ( + +
Pikachu
+
Charmander
+
Squirtle
+
Bulbasaur
+
+ ); +} ``` Also the gap between columns can be set by setting the `gap` prop: ```jsx - -
1
-
2
-
3
-
4
-
+import { Plock } from "react-plock"; + +export function Komponent() { + return ( + +
Pikachu
+
Charmander
+
Squirtle
+
Bulbasaur
+
+ ); +} ``` Needs also some extra styling? No problem, you can extend the default styles by setting the `style` or the `className` prop: ```jsx - -
1
-
2
-
3
-
4
-
+import { Plock } from "react-plock"; + +export function Komponent() { + return ( + +
Pikachu
+
Charmander
+
Squirtle
+
Bulbasaur
+
+ ); +} ``` ### Built With 🏗️ -- [ReactJS](https://reactjs.org/) - React +- [ReactJS](https://reactjs.org/) ### Versioning 🚦