1.2.15 • Published 7 months ago

react-fog v1.2.15

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Demo

scroll-x scroll tab fog-color fog-range

Project

A component that adds a fog effect to indicate scrollability to overflowed components.

Getting Started

npm i react-fog

Usage 1 - X-axis scroll fog effect

import Fog from 'react-fog';

const LargeWidthComp = () => {
  return (
    <Fog> // width: "100%", overflow: "auto"
      <LargeWidth/>
    </Fog>
  )
};

Usage 2 - X-axis, Y-axis scroll fog effect

import Fog from 'react-fog';

const LargeWidthComp = () => {
  return (
    <Fog height={300}> // width: "100%", height: "300px", overflow: "auto"
      <LargeWidthAndLargeHeight/>
    </Fog>
  )
};

Usage 3 - Change Fog color

import Fog from 'react-fog';

const LargeWidthComp = () => {
  return (
    <Fog fogColor="#0af373" height={300}>
      <LargeWidthAndLargeHeight/>
    </Fog>
  )
};

Usage 4 - Change Fog range

import Fog from 'react-fog';

const LargeWidthComp = () => {
  return (
    <Fog fogRange={25} height={300}> // 25px, default 7px
      <LargeWidthAndLargeHeight/>
    </Fog>
  )
};

Usage 5 - Width MUi Table example

import Fog from 'react-fog';
import { Table, TableBody, TableCell, TableHead, TableRow } from "@mui/material";
import _ from "lodash";

const FogTable = () => {
  return (
    <Fog fogColor="#98fa7a" fogRange={30} height={250}>
      <Table>
        <TableHead>
          <TableRow>
            {_.range(0, 7).map((i) => (
              <TableCell key={`table-head-${i}`} width={200}>
                table head {i}
              </TableCell>
            ))}
          </TableRow>
        </TableHead>
        <TableBody>
          {_.range(0, 10).map((i) => (
            <TableRow key={`row-${i}`}>
              <TableCell width={200}>table cell {i}-1</TableCell>
              <TableCell width={200}>table cell {i}-2</TableCell>
              <TableCell width={200}>table cell {i}-3</TableCell>
              <TableCell width={200}>table cell {i}-4</TableCell>
              <TableCell width={200}>table cell {i}-5</TableCell>
              <TableCell width={200}>table cell {i}-6</TableCell>
              <TableCell width={200}>table cell {i}-7</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </Fog>
  )
};

Usage 6 - MUi Chip example

import Fog from 'react-fog';
import { Chip, Box } from "@mui/material";
import _ from "lodash";

const FogTable = () => {
  return (
    <Fog fogColor="#eee" fogRange={10}>
      <Box display="flex" gap={2}>
        {_.range(0, 10).map((i) => (
          <Chip color="info" key={i} label={`label-${i}`} />
        ))}
      </Box>
    </Fog>
  )
};

LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.

Need Help?

Have questions or issues? Please open an issue.

1.2.14-rc.0

7 months ago

1.2.9

7 months ago

1.2.12

7 months ago

1.2.13

7 months ago

1.2.10

7 months ago

1.2.11

7 months ago

1.2.14

7 months ago

1.2.15

7 months ago

1.2.7

12 months ago

1.2.6

12 months ago

1.2.5

12 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

0.1.0

4 years ago