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

rn-segmented-tab-controls

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-segmented-tab-controls

A lightweight React Native library for segmented control and tab navigation with no dependencies

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Segmented and Tab control V.1.0.0

Installation

  1. Install library
    npm install rn-segmented-tab-controls
    

SegmentedControl Component

  1. Use components

import {SegmentedControl} from 'rn-segmented-tab-controls';

const App = () => {
  const [value, setValue] = useState('tab1');

  const values = [
    {key: 'Tab 1', value: 'tab1'},
    {key: 'Tab 2', value: 'tab2'},
  ];

  return (
    <SegmentedControl
      label="Segmented Control"
      values={values}
      onChange={value => setValue(value)}
    />
  );
};

Properties

PropDescriptionTypeRequiredDefault
valuesKey and value array to generate each tab.{key: string; value: string}[]YesNone
onChangeFunction that returns the selected value.(value: string) => voidYesNone_
labelThe label with which you want to identify the segmentedControl.stringNoNone
labelStyleStyles for label.StyleProp<TextStyle>NoNone
selectedIndexSelected initial value.numberNo0
backgroundColorSegmentedControl background color.stringNo'#CCCCCC'
tintColorTint color for the selected tab.stringNo'#FFFFFF'
textColorText color in the segmentedControl.stringNo'#000000'
selectedTextColorText color en the selected tab.stringNo'#000000'
styleStyles for the component container.StyleProp<ViewStyle>NoNone

TabControl Component

import {TabControl} from 'rn-segmented-tab-controls';
import {FormUser, Users} from './components';

const App = () => {
  const values = [
    {key: 'Add user', renderItem: FormUser},
    {key: 'Users', renderItem: Users},
  ];

  return <TabControl values={values} />;
};

Properties

PropDescriptionTypeRequiredDefault
valuesKey and renderItem array to generate each tab.{key: string; renderItem: JSX.Element}[]YesNone
labelThe label with which you want to identify the tabControl.stringNoNone
labelStyleStyles for label.StyleProp<TextStyle>NoNone
selectedIndexSelected initial value.numberNo0
backgroundTabColorTabControl background color.stringNo'#CCCCCC'
tabTintColorTint color for the selected tab.stringNo'#FFFFFF'
textColorText color in the TabControl.stringNo'#000000'
selectedTextColorText color en the selected tab.stringNo'#000000'
containerStyleStyles for the rendered component.StyleProp<ViewStyle>NoNone
styleStyles for the component container.StyleProp<ViewStyle>NoNone

License

This project is licenced under the MIT License.

Keywords

FAQs

Package last updated on 19 Mar 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

  • 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