An open API service indexing awesome lists of open source software.

https://github.com/tobua/naxos

React Native UI Library
https://github.com/tobua/naxos

library react-native ui ui-components

Last synced: 3 months ago
JSON representation

React Native UI Library

Awesome Lists containing this project

README

        


naxos Preview

# naxos

naxos

[![npm](https://img.shields.io/npm/v/naxos)](https://npmjs.com/naxos)
[![codesandbox](https://img.shields.io/badge/demo-codesandbox-yellow)](https://codesandbox.io/s/naxos-web-ypb2ny)

React Native UI components library.

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

## Installation

```
npm i naxos
```

## Usage

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

const App = () => (





React Native UI Library





Home


Profile



)

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

## Components

### `NavBar`

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

const Navigation = (


Back

naxos


)
```

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`

```jsx
import { TabBar } from 'naxos'

const Tab = ({ label, active }) => (

{label}

)

const tabBar = (
console.log(key)}>




)
```

### `Button`

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

```jsx
const textButton = alert('clicked')} />
const customButton = (
alert('clicked')}>
Custom button content

)
```

### `Text`

```jsx
const regularText = Regular text.
const largeText = Hello title.
const boldText = Bold and important text.
```

### `Input`

```jsx
import { Input } from 'naxos'

const regularInput =
```

### `Dropdown`

```jsx
import { Dropdown } from 'naxos'

const simpleDropdown = (
alert(option)} />
)
```

### `Content`

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

```jsx
import { Content, Button } from 'naxos'

const WrappedButton = (

alert('Hello World')} />

)
```

### `Icon`

```jsx
import { Icon } from 'naxos'

const backPointer =
const hamburgerMenu =
```

### `Avatar`

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

const smallAvatar =
const customImage =
```

### `Intro`

```jsx
import { Intro, Text } from 'naxos'

const Slides = (
setDone(true)}>

First Slide


Second Slide


)
```

### `Tabs`

```jsx
import { Tabs } from 'naxos'

const tabs = (

Home Content
Profile Content
About Content

)
```

### `AbsoluteButton`

```jsx
import { AbsoluteButton } from 'naxos'

const Slides = (

)
```

## 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.

```jsx
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 }) => (

{label}

)
```

## Configuration

```jsx
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)
```