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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-cosmos-button

v0.0.10

Published

A customizable, reusable set of button components for React Native applications. This package provides beautifully styled buttons (primary, secondary, outline, icon-based, and more) designed to speed up development and maintain consistency across apps.

Readme

React Native Cosmos Button

A customizable, reusable set of button components for React Native applications. This package provides beautifully styled buttons (primary, secondary, outline, icon-based, and more) designed to speed up development and maintain consistency across apps.

React Native Cosmos Button

Installation

npm i react-native-cosmos-button

If you want to use icons install react-native-vector-icons

npm install react-native-vector-icons

Buttons Component

Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | title | string | Yes | - | The button title to render | | onPress | function | Yes | - | The function to call when the button is pressed | | type | 'Raised', 'Stroked', 'Flat' | Yes | - | The type of button to render | | bgColor | string | Yes | #555555 | The background color of the button | | radius | number | No | 8 | The radius of the button | | paddingVertical | number | No | 10 | The vertical padding of the button | | paddingHorizontal | number | No | 10 | The horizontal padding of the button | | fontSize | number | No | 16 | The font size of the button text | | disabled | boolean | No | false | Whether the button is disabled | | isAPICall | boolean | No | false | Whether the button is an API call | | margin | number | No | 0 | The margin of the button | | fontFamily | string | No | - | The font family of the button text | | iconName | string | No | - | The name of the icon to render | | iconFamily | 'AntDesign', 'Entypo', 'EvilIcons', 'Feather', 'FontAwesome', 'FontAwesome5', 'FontAwesome5Pro', 'Fontisto', 'Foundation', 'Ionicons', 'MaterialCommunityIcons', 'MaterialIcons', 'Octicons', | No | - | The family of the icon to render | | iconPosition | 'left', 'right' | No | 'left' | The position of the icon | | children | React.ReactNode | No | - | The children of the button | | childrenPosition | 'left', 'right' | No | - | The position of the children |

Example Usage

Basic Button

import { Buttons } from 'react-native-cosmos-button';

<Buttons
    title={"Submit"}
    onPress={() => { console.log("Submit") }}
    type={'Flat'}
    paddingVertical={10}
    paddingHorizontal={10}
    fontSize={19}
    isAPICall={false}
    disabled={false}
    bgColor={Colors.ui_dark_bg}
    fontFamily={Fonts.poppins500Medium}
/>

Icon Button

If you want to use icons install react-native-vector-icons and configer it in your project. You can use iconName, iconFamily and iconPosition props.

import { Buttons } from 'react-native-cosmos-button';

<Buttons
    title={"Submit"}
    onPress={() => { console.log("Submit") }}
    type={'Flat'}
    paddingVertical={10}
    paddingHorizontal={10}
    fontSize={19}
    isAPICall={false}
    disabled={false}
    bgColor={Colors.ui_dark_bg}
    fontFamily={Fonts.poppins500Medium}
    iconName="angle-double-right"
    iconFamily={'FontAwesome5'}
    iconPosition={'right'}
/>

Render React Element as a child

You can render React Element as a child, then you want use childrenPosition prop and passing the React element as a child.

import { Buttons } from 'react-native-cosmos-button';

<Buttons
    title={"Get Started"}
    onPress={() => { console.log("Get Started")}}
    type={'Flat'}
    radius={10}
    paddingVertical={10}
    paddingHorizontal={10}
    fontSize={19}
    isAPICall={false}
    disabled={false}
    bgColor={Colors.ui_dark_bg}
    fontFamily={Fonts.poppins500Medium}
    childrenPosition={'left'}
>
    <Image style={{ width: 20, height: 20 }} source={require("../../assets/images/image.png")} />
</Buttons>