Giter VIP home page Giter VIP logo

semantic-ui-react-scrollbar's Introduction

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

property description
className class name(s) for HTML outer div element
orientation Scroll bar orientation

Optional Scrollbar property types

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

Default values for optional properties

className: undefined,
orientation: 'horizontal'

Keyboard actions

Key Action
ArrowUp Scrolls vertical scroll bar upwards
ArrowDown Scrolls vertical scroll bar downwards
ArrowLeft Scrolls horizontal scroll bar to the left
ArrowRight Scrolls 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

semantic-ui-react-scrollbar's People

Contributors

dependabot[bot] avatar pksilen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

lizhengdao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.