my-custom-button-aa
v1.0.0
Published
Custom Button for React Native
Readme
my-custom-button-aa
A small, customizable button component for React Native apps.
Requirements
This package expects your app to already include:
- react
>=18 - react-native
>=0.74
These are listed as peer dependencies and are not bundled with the library.
Installation
npm install my-custom-button-aaOr with Yarn:
yarn add my-custom-button-aaUsage
import CustomButton from "my-custom-button-aa";
export default function App() {
return (
<CustomButton
title="Save"
onPress={() => console.log("pressed")}
/>
);
}With custom styles
<CustomButton
title="Delete"
disabled={isLoading}
style={{ backgroundColor: "#dc2626" }}
textStyle={{ fontSize: 14 }}
onPress={handleDelete}
/>API
CustomButton
| Prop | Type | Default | Description |
| ---------- | ---------------------------- | ------------ | ------------------------------------ |
| title | string | "Click me" | Button label |
| onPress | () => void | () => {} | Called when the button is pressed |
| style | StyleProp<ViewStyle> | — | Merged with the default button style |
| textStyle| StyleProp<TextStyle> | — | Merged with the default text style |
| disabled | boolean | false | Disables press interaction |
Types
import CustomButton, { type CustomButtonProps } from "my-custom-button-aa";Development
Clone the repo and install dependencies:
npm installBuild the compiled output (emitted to lib/):
npm run buildThe published package entry points are:
- main:
lib/index.js - types:
lib/index.d.ts
Publishing
- Ensure the package name is available on npm.
- Run
npm run build(also runs automatically viaprepublishOnly). - Log in:
npm login - Publish:
npm publish
Preview what will be included in the tarball:
npm pack --dry-runLicense
ISC — see LICENSE (add a LICENSE file in the repo root before publishing if you have not already).
Author
Adithya
