Socket
Socket
Sign inDemoInstall

semantic-ui-react-scrollbar

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    semantic-ui-react-scrollbar

Horizontal and vertical scroll bar for Semantic UI React


Version published
Weekly downloads
13
increased by333.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

:closed_book: Check out my new book Clean Code Principles And Patterns: A Software Practitioner's Handbook

semantic-ui-react-scrollbar

Horizontal and vertical scroll bar for Semantic UI React

version build Downloads coverage Quality Gate Status Bugs Vulnerabilities MIT License

Prerequisites

"react": "^16.0.0",
"react-dom": "^16.0.0",
"semantic-ui-react": "^0.87.0"

Installation

npm install --save semantic-ui-react-scrollbar

Demo

Scrollbar demo

Example usage

import React from 'react';
import Scrollbar from 'semantic-ui-react-scrollbar';

class ScrollbarExample extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            scrollPosition: '0'
        };
    }

    changeScrollPosition = (newScrollPosition) => {
        this.setState({ scrollPosition: newScrollPosition });
    }

    render() => {(
        <Scrollbar maxScrollPosition={10} changeScrollPosition={this.changeScrollPosition} />
    )};
}

See full example in demo directory

Mandatory Scrollbar properties

changeScrollPosition: (newScrollPosition: number) => void,
maxScrollPosition: number

     

Optional Scrollbar properties

propertydescription
classNameclass name(s) for HTML outer div element
orientationScroll bar orientation

Optional Scrollbar property types

className: string,
orientation: 'horizontal' | 'vertical'
    

Default values for optional properties

className: undefined,
orientation: 'horizontal'

Keyboard actions

KeyAction
ArrowUpScrolls vertical scroll bar upwards
ArrowDownScrolls vertical scroll bar downwards
ArrowLeftScrolls horizontal scroll bar to the left
ArrowRightScrolls horizontal scroll bar to the right

Styling example

<Scrollbar className="myScrollbar" .... />

Style scroll bar in CSS:

.myScrollbar .button {
    /* style buttons here */
}

.myScrollbar .track {
   /* style scroll bar track here */
}

.myScrollbar .thumb {
    /* style scroll bar thumb here */
}

License

MIT License

Keywords

FAQs

Last updated on 02 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc