Skip to content

Commit

Permalink
docs: readme improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mordech committed Sep 30, 2023
1 parent 52e2732 commit 15f1fe6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/dynamic-grid-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ npm install @mordech/dynamic-grid-core
This is a function that calculates the number of columns that can fit in a given space, taking into account the minimum width of each column, the width of the elements, and any gaps between the columns.

### Usage

To use this function, import it into your project and call it with an object that contains the following properties:

- `minWidth`: The minimum width of each column.

- `elementWidth`: The width of the elements that will be placed in the columns.
- `elementWidth`: The width of the container element.

- `gap`: The gap between each column (optional, defaults to 0).
- `gap`: The gap between each column in px (optional, defaults to 0).

- `dividedBy`: The number to divide the number of columns by (optional, defaults to 1).
- `dividedBy`: The number to divide the number of columns by (optional, defaults to 1). For example if you want the number of columns to be even, you can set this to 2.

- `maxColumns`: The maximum number of columns that can be displayed (optional, defaults to Infinity).

- `scrollHint`: A number between 0 and 1 that indicates how much of the next column should be shown in a scroll (optional, defaults to 0).
- `scrollHint`: A number between 0 and 1 that indicates how much of the next column should be shown in a scroll (optional, defaults to 0). For example, if you want to show half of the next column, you can set this to 0.5.

The function returns the number of columns that can fit in the given space.

Expand Down
2 changes: 1 addition & 1 deletion packages/dynamic-grid-react/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DynamicGrid Component

The `DynamicGrid` component is a React component that allows for dynamic grid layouts. It uses the `@mordech/dynamic-grid-core` library to calculate the number of columns based on the available space and the minimum column width.
The `DynamicGrid` component is a React component that allows for dynamic grid layouts. It uses the [`@mordech/dynamic-grid-core`](https://www.npmjs.com/package/@mordech/dynamic-grid-core) library to calculate the number of columns based on the available space and the minimum column width.

## Installation

Expand Down
8 changes: 5 additions & 3 deletions packages/dynamic-grid-web/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DynamicGrid Web Component

The `MrdDynamicGridElement` component is a web component built with LitElement that allows for dynamic grid layouts. It uses the `@mordech/dynamic-grid-core` library to calculate the number of columns based on the available space and the minimum column width.
The `mrd-dynamic-grid` component is a web component built with LitElement that allows for dynamic grid layouts. It uses the [`@mordech/dynamic-grid-core`](https://www.npmjs.com/package/@mordech/dynamic-grid-core) library to calculate the number of columns based on the available space and the minimum column width.

## Installation

Expand All @@ -15,10 +15,12 @@ npm install @mordech/dynamic-grid-core @mordech/dynamic-grid-element
To use the `MrdDynamicGridElement` component, you can import it and use it like any other web component:

```html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<script type="module" src="@mordech/dynamic-grid-web"></script>
<script type="module">
import '@mordech/dynamic-grid-web';
</script>
</head>
<body>
<mrd-dynamic-grid
Expand Down

0 comments on commit 15f1fe6

Please sign in to comment.