npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

naxos

v2.2.4

Published

React Native UI components library.

Downloads

5

Readme

naxos

npm codesandbox

React Native UI components library.

  • NavBar, TabBar
  • Button, Text, Input, Dropdown, Content
  • Icon, Avatar
  • Intro, Tabs, AbsoluteButton

Installation

npm i naxos

Usage

import React from 'react'
import { AppRegistry, SafeAreaView, ScrollView } from 'react-native'
import { NavBar, TabBar, Text, Content } from 'naxos'

const App = () => (
  <SafeAreaView style={{ flex: 1 }}>
    <NavBar title="naxos" />
    <ScrollView>
      <Content>
        <Text large bold>
          React Native UI Library
        </Text>
      </Content>
    </ScrollView>
    <TabBar>
      <TabBar.Tab key="home">
        <Text>Home</Text>
      </TabBar.Tab>
      <TabBar.Tab key="profile">
        <Text>Profile</Text>
      </TabBar.Tab>
    </TabBar>
  </SafeAreaView>
)

AppRegistry.registerComponent('naxos', () => App)

Components

NavBar

import { NavBar, Button, Text, Avatar } from 'naxos'

const Navigation = (
  <NavBar>
    <Button key="left" onPress={back}>
      Back
    </Button>
    <Text key="middle">naxos</Text>
    <Avatar key="right" onPress={go('Profile')} image={userImage} />
  </NavBar>
)

The key property is required on the root child to indicate the desired position. It can also be placed on a Fragment or a View wrapping multiple other elements.

TabBar

import { TabBar } from 'naxos'

const Tab = ({ label, active }) => (
  <TabBar.Tab>
    <Text bold={active}>{label}</Text>
  </TabBar.Tab>
)

const tabBar = (
  <TabBar onPress={(key) => console.log(key)}>
    <Tab key="home" label="Home" />
    <Tab key="trending" label="Trending" />
    <Tab key="about" label="About" />
  </TabBar>
)

Button

By default the button will appear as text in the Color.interact color to indicate a possible action.

const textButton = <Button title="Click me" onPress={() => alert('clicked')} />
const customButton = (
  <Button onPress={() => alert('clicked')}>
    <Text>Custom button content</Text>
  </Button>
)

Text

const regularText = <Text>Regular text.</Text>
const largeText = <Text large>Hello title.</Text>
const boldText = <Text bold>Bold and important text.</Text>

Input

import { Input } from 'naxos'

const regularInput = <Input placeholder="Enter text..." />

Dropdown

import { Dropdown } from 'naxos'

const simpleDropdown = (
  <Dropdown options={['Home', 'Profile', 'About']} onChange={(option) => alert(option)} />
)

Content

Wraps content with Space.medium to the side and Space.small for top and bottom.

import { Content, Button } from 'naxos'

const WrappedButton = (
  <Content>
    <Button title="Hello" onPress={() => alert('Hello World')} />
  </Content>
)

Icon

import { Icon } from 'naxos'

const backPointer = <Icon name="pointer" direction="left" />
const hamburgerMenu = <Icon name="menu" />

Avatar

import { Avatar } from 'naxos'
import profileImage from './some-image.png'

const smallAvatar = <Avatar size="small" />
const customImage = <Avatar source={profileImage} />

Intro

import { Intro, Text } from 'naxos'

const Slides = (
  <Intro skippable onDone={() => setDone(true)}>
    <Intro.Slide key="first">
      <Text>First Slide</Text>
    </Intro.Slide>
    <Intro.Slide key="second">
      <Text>Second Slide</Text>
    </Intro.Slide>
  </Intro>
)

Tabs

import { Tabs } from 'naxos'

const tabs = (
  <Tabs labels={['Home', 'Profile', 'About']}>
    <Text>Home Content</Text>
    <Text>Profile Content</Text>
    <Text>About Content</Text>
  </Tabs>
)

AbsoluteButton

import { AbsoluteButton } from 'naxos'

const Slides = (
  <AbsoluteButton
    type="back | close | add"
    position="top-left | top-right | bottom-left | bottom-right"
  />
)

Style

The plugin includes helper values for Color, Space and Font that are shared with the build in components and can also be configured as shown in the next paragraph.

The default styles used by the built-in components can be inspected and extended to allow for significant customization.

import { Color, Space, Font, Button } from 'naxos'

const buttonStyles = Button.createStyles()

buttonStyles.wrapper.padding = Space.small
buttonStyles.wrapper.backgroundColor = Color.highlight
buttonStyles.wrapper.borderRadius = Space.tiny

export const CustomizedButton = ({ label, ...props }) => (
  <Button styles={buttonStyles} {...props}>
    {label}
  </Button>
)

Configuration

import { AppRegistry } from 'react-native'
import { configure } from 'naxos'
import { App } from './App'

configure({
  Color: {
    interact: '#009695',
    highlight: '#7e0ce1',
  },
  Space: {
    medium: 25,
  },
  Font: {
    bold: {
      fontWeight: 700,
    },
  },
})

AppRegistry.registerComponent('app', () => App)