basic_button_sdk
v1.0.1
Published
A customizable button component for React Native applications.
Readme
Basic Button SDK
A customizable button component for React Native applications.
Installation
npm install basic-button-sdk
# or
yarn add basic-button-sdkUsage
import { ButtonSDK } from "basic-button-sdk";
export default function App() {
return (
<ButtonSDK
text="Press Me"
onPress={() => console.log("Button pressed!")}
variant="primary"
size="medium"
/>
);
}Props
| Prop | Type | Default | Description | | --------- | ------------------------------------- | --------- | ------------------------------------------------ | | text | string | - | The text to display inside the button | | onPress | () => void | - | Callback function when button is pressed | | style | StyleProp | - | Optional style override for the button container | | textStyle | StyleProp | - | Optional style override for the button text | | disabled | boolean | false | Whether the button is in a disabled state | | loading | boolean | false | Whether to show a loading indicator | | variant | 'primary' | 'secondary' | 'outline' | 'primary' | The variant of the button | | size | 'small' | 'medium' | 'large' | 'medium' | The size of the button |
Variants
primary: Filled button with accent color backgroundsecondary: Filled button with light backgroundoutline: Outlined button with transparent background
Sizes
small: Compact buttonmedium: Standard buttonlarge: Large button
Example
import { ButtonSDK } from "basic-button-sdk";
export default function Example() {
return (
<>
{/* Primary Button */}
<ButtonSDK
text="Primary Button"
onPress={() => {}}
variant="primary"
size="medium"
/>
{/* Secondary Button */}
<ButtonSDK
text="Secondary Button"
onPress={() => {}}
variant="secondary"
size="medium"
/>
{/* Outline Button */}
<ButtonSDK
text="Outline Button"
onPress={() => {}}
variant="outline"
size="medium"
/>
{/* Loading State */}
<ButtonSDK text="Loading..." loading={true} onPress={() => {}} />
{/* Disabled State */}
<ButtonSDK text="Disabled" disabled={true} onPress={() => {}} />
</>
);
}License
MIT
