Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

custom-react-scroller

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-react-scroller

A react scroller component

  • 2.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

custom-react-scroller

NPM JavaScript Style Guide

Install

npm install --save custom-react-scroller

Screenshot Example

example Screenshot

Demo Example

Demo

Props

  • rightIcon: Render the right icon component as you wish. (optional)
  • leftIcon: Render the left icon component as you wish. (optional)

Usage

import React from 'react'
import Scroller from 'custom-react-scroller'
import 'custom-react-scroller/dist/index.css'
import './example.style.css'

const App = () => {
  return (
    <div className='container'>
      <div className='scrollerContainer'>
        <Scroller>
          {[...Array(20).keys()].map((val, indx) => {
            return (
              <div className='buttons' key={indx}>
                <span className='buttonContent'>button {indx + 1}</span>
              </div>
            )
          })}
        </Scroller>
      </div>
    </div>
  )
}

export default App

example.style.css

.container {
  max-width: 1000px;
  padding: 10px;
  background-color: #f3f3f3;
  margin: 10px auto;
  width: 90vw;
  padding: 10px;
  padding-top: 30px;
}

@media (min-width: 768px) {
  .container {
    width: 50vw;
  }
}

.codeContainer {
  overflow: auto;
  text-align: left;
  height: 100%;
  width: 100%;
}

.scrollerContainer {
  background-color: white;
  padding: 8px 4px;
  border-radius: 16px;
  border: 1px solid #e4e4e4cc;
}

.buttons {
  padding: 0 12px;
  background: #e0e0e0;
  margin: 4px 8px 4px 0;
  border-radius: 16px;
  font-size: 14px;
  height: 32px;
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  line-height: 20px;
  max-width: 100%;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  white-space: nowrap;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}

.buttonContent {
  align-items: center;
  display: inline-flex;
  height: 100%;
  max-width: 100%;
}

Made with :heart:

License

MIT © copy-ninja1

Keywords

FAQs

Package last updated on 03 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc