You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-scroll-menu

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-scroll-menu

React native scrolling menu

1.1.3
latest
Source
npmnpm
Version published
Weekly downloads
33
-43.1%
Maintainers
0
Weekly downloads
 
Created
Source

platforms npm npm

@sekizlipenguen/react-native-scroll-menu

React Native horizontal scrolling button menu.
This package has been moved to the @sekizlipenguen scope for better organization.

Installation

Install the package using npm or yarn:

npm install @sekizlipenguen/react-native-scroll-menu
yarn add @sekizlipenguen/react-native-scroll-menu

Example

Example

Usage

Here’s a simple example of how to use the @sekizlipenguen/react-native-scroll-menu:

Class Component Example

import React, { Component } from 'react';
import { View } from 'react-native';

// Import the component
import ScrollingButtonMenu from '@sekizlipenguen/react-native-scroll-menu';

export default class Example extends Component {
  render() {
    return (
      <ScrollingButtonMenu
        items={[
          { id: "1", name: 'Life' },
          { id: "2", name: 'Time' },
          { id: "3", name: 'Faith' },
          { id: "4", name: 'Cosmos' },
          { id: "5", name: 'Fall' },
        ]}
        onPress={(e) => console.log(e)}
        selected={"1"}
      />
    );
  }
}

Functional Component with Hook Example

import React, { useState } from 'react';
import { View, Text } from 'react-native';

// Import the component
import ScrollingButtonMenu from '@sekizlipenguen/react-native-scroll-menu';

const ExampleWithHook = () => {
  const [selectedItem, setSelectedItem] = useState("1");

  const handlePress = (item) => {
    console.log(item);
    setSelectedItem(item.id);
  };

  return (
    <View>
      <ScrollingButtonMenu
        items={[
          { id: "1", name: 'Life' },
          { id: "2", name: 'Time' },
          { id: "3", name: 'Faith' },
          { id: "4", name: 'Cosmos' },
          { id: "5", name: 'Fall' },
        ]}
        onPress={handlePress}
        selected={selectedItem}
      />
      <Text>Selected Item: {selectedItem}</Text>
    </View>
  );
};

export default ExampleWithHook;

Props

KeyTypeDescription
itemsArrayArray for button menu (required).
onPressFunction(menu)Function triggered on button press (required).
upperCaseBooleanConvert text to uppercase. Default: false.
selectedOpacityNumberOpacity when button is pressed. Default: 0.7.
containerStyleObjectStyle for the container.
contentContainerStyleObjectStyle for the content container.
scrollStyleObjectStyle for the scroll view.
textStyleObjectStyle for the text.
buttonStyleObjectStyle for the button.
activeButtonStyleObjectStyle for the active button.
firstButtonStyleObjectStyle for the first button.
lastButtonStyleObjectStyle for the last button.
activeTextStyleObjectStyle for the active text.
activeColorStringActive button text color. Default: "#ffffff".
activeBackgroundColorStringActive button background color. Default: "#ffffff".
selectedString or NumberSelected item id. Default: 1.
keyboardShouldPersistTapsStringDefault: "always".

Thank You!

We appreciate your support and feedback! If you encounter any issues, feel free to open an issue.

Keywords

scrolling menu horizontal

FAQs

Package last updated on 23 Dec 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.