Demo Example
import { Typography } from "compo-v1";
export default function TypographyCompoEx(): JSX.Element | null {
return (
<Typography
type="LargeTitle1"
text={"LargeTitle1"}
customStyle={{ color: color.red }}
/>
<Typography
type="LargeTitle2"
text={"LargeTitle2"}
customStyle={{ color: color.blue }}
/>
<Typography
type="Title1"
text={"Title1"}
customStyle={{ color: color.primarytext }}
/>
<Typography
type="Title3"
text={"Title3"}
customStyle={{ color: color.blue, fontFamily: "SailecMedium" }}
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of Typography |
text |
string |
required |
Text you want to show |
customStyle |
TextStyle |
optional |
style to be applied on text |
<Typography
type="LargeTitle1"
text={"LargeTitle1"}
/>
<Typography
type="LargeTitle2"
text={"LargeTitle2"}
/>
<Typography
type="Title1"
text={"Title1"}
/>
<Typography
type="Title2"
text={"Title2"}
/>
<Typography
type="Title3"
text={"Title3"}
/>
<Typography
type="Title4"
text={"Title4"}
/>
<Typography
type="Headline1"
text={"Headline1"}
/>
<Typography
type="Headline2"
text={"Headline2"}
/>
<Typography
type="Subheadline"
text={"Subheadline"}
/>
<Typography
type="BodyLink"
text={"BodyLink"}
/>
<Typography
type="Body"
text={"Body"}
/>
<Typography
type="BodyBold"
text={"BodyBold"}
/>
<Typography
type="Caption1"
text={"Caption1"}
/>
<Typography
type="Caption2"
text={"Caption2"}
/>
<Typography
type="Caption3"
text={"Caption3"}
/>
<Typography
type="TabItemsInactive"
text={"TabItemsInactive"}
/>
<Typography
type="TabItemsActive"
text={"TabItemsActive"}
/>
<Typography
type="ButtonSmall"
text={"ButtonSmall"}
/>
<Typography
type="ButtonMedium"
text={"ButtonMedium"}
/>
<Typography
type="ButtonLarge"
text={"ButtonLarge"}
/>
<Typography
type="TabBarInactive"
text={"TabBarInactive"}
/>
<Typography
type="TabBarActive"
text={"TabBarActive"}
/>
import { Button } from "compo-v1";
export default function ButtonCompoEx(): JSX.Element | null {
return (
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryLarge"
buttonTitle="button1"
onPress={() => {}}
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of button |
buttonTitle |
string |
required |
text on button |
onPress |
function |
required |
Action performed on button click |
customTextStyle |
TextStyle |
optional |
style to be applied on text |
customButtonStyle |
ViewStyle |
optional |
style to be applied on button |
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primarySmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryHoverLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryHoverMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryHoverSmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryActiveLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryActiveMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryActiveSmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryDisableLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryDisableMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="primaryDisableSmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondarySmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryHoverLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryHoverMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryHoverSmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryActiveLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryActiveMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryActiveSmall"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryDisableLarge"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryDisableMedium"
buttonTitle="button1"
onPress={() => {}}
/>
<Button
customButtonStyle={{ marginBottom: 15 }}
type="secondaryDisableSmall"
buttonTitle="button1"
onPress={() => {}}
/>
FooterButton
import { FooterButton } from "compo-v1";
export default function FooterButtonCompoEx(): JSX.Element | null {
return (
<FooterButton
type="doubleFooterButton"
buttonTitle="DoublePrimaryButton"
secondButtonTitle="DoubleNonPrimaryButton"
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of footerButton |
buttonTitle |
string |
required |
text on button |
onPress |
function |
required |
Action performed on button click |
secondButtonTitle |
string |
required |
text on bottom button, if there are two buttons |
onSecondButtonPress |
function |
required |
Action performed on bottom button click, if there are two buttons |
customTextStyle |
TextStyle |
optional |
style to be applied on text |
customButtonStyle |
ViewStyle |
optional |
style to be applied on button |
customButtonContainerStyle |
ViewStyle |
optional |
style to be applied on contanier, if there are two buttons |
disabled |
boolean |
optional |
To disabled the button |
singleFooterButton
<FooterButton
type="singleFooterButton"
buttonTitle="SinglePrimaryButton"
customButtonStyle={{ marginBottom: 30 }}
onPress={()=>{}}
/>
doubleFooterButton
<FooterButton
type="doubleFooterButton"
buttonTitle="DoublePrimaryButton"
secondButtonTitle="DoubleNonPrimaryButton"
onPress={()=>{}}
onSecondButtonPress={()=>{}}
/>
import { RadioButton } from "compo-v1";
export default function RadioButtonCompoEx(): JSX.Element | null {
const [isChecked, setIsChecked] = useState(false);
const handleRadioButtonPress = (option: string) => {
setIsChecked(!isChecked);
};
return (
<RadioButton
type="primaryRadioButton"
selected={isChecked}
onPress={() => handleRadioButtonPress("option")}
radioButtonStyle={{ backgroundColor:"#ECF0FF" }}
radioButtonSelectedStyle={ backgroundColor: "#503374"}
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of radio button |
onPress |
function |
required |
Action performed on button click |
selected |
boolean |
false |
true if button is selected |
radioButtonStyle |
ViewStyle |
optional |
style to be applied on radio button |
radioButtonSelectedStyle |
ViewStyle |
optional |
style to be applied on selected radio button |
<RadioButton
type="primaryRadioButton"
selected={isChecked}
onPress={() => handleRadioButtonPress("option")}
radioButtonStyle={{ backgroundColor:"#ECF0FF" }}
radioButtonSelectedStyle={ backgroundColor: "#503374"}
/>
<RadioButton
type="disableRadioButton"
selected={isChecked}
onPress={() => handleRadioButtonPress("option")}
radioButtonStyle={{ backgroundColor:"#ECF0FF" }}
radioButtonSelectedStyle={ backgroundColor: "#503374"}
/>
import { ToggleButton } from "compo-v1";
export default function ToggleButtonCompoEx(): JSX.Element | null {
const handleToggle = (value: boolean) => {
console.log("Toggle value:", value);
};
return (
<ToggleButton
onToggle={() => handleToggle}
activebgColor="#ECF0FF"
activethumbColor="#503374"
inActivebgColor="#ECF0FF"
inActivethumbColor="#503374"
style={{ marginBottom: 20 }}
type="primaryToggleButton"
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of toggle |
onPress |
function |
required |
Action performed on toggle |
style |
ViewStyle |
optional |
style to be applied on toggle container |
activebgColor |
string |
optional |
Background color of the toggle button when active. |
activethumbColor |
string |
optional |
Thumb color of the toggle button when active. |
inActivebgColor |
string |
optional |
Background color of the toggle button when inactive. |
inActivethumbColor |
string |
optional |
Thumb color of the toggle button when inactive. |
<ToggleButton
activebgColor="#ECF0FF"
activethumbColor="#503374"
inActivebgColor="#ECF0FF"
inActivethumbColor="#503374"
onToggle={() => handleToggle}
style={{ marginBottom: 20 }}
type="primaryToggleButton"
/>
<ToggleButton
activebgColor="#ECF0FF"
activethumbColor="#503374"
inActivebgColor="#ECF0FF"
inActivethumbColor="#503374"
onToggle={() => handleToggle}
style={{ marginBottom: 20 }}
type="disableToggleButton"
/>
import { CheckboxButton } from "compo-v1";
export default function CheckboxButtonCompoEx(): JSX.Element | null {
const [isChecked, setIsChecked] = useState(false);
const handleCheckboxChange = (checked: boolean) => {
setIsChecked(checked);
};
return (
<CheckboxButton
type="primaryCheckboxButton"
checked={isChecked1}
onChange={handleCheckboxChange1}
customBoxStyle={{ marginBottom: 15 }}
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of toggle |
onChange |
function |
required |
Action performed on checked |
checked |
boolean |
false |
true if checkbox is checked |
customBoxStyle |
ViewStyle |
optional |
style to be applied on check box |
<CheckboxButton
type="primaryCheckboxButton"
checked={isChecked}
onChange={handleCheckboxChange1}
customBoxStyle={{ marginBottom: 15 }}
/>
<CheckboxButton
type="disableCheckboxButton"
checked={isChecked2}
onChange={handleCheckboxChange2}
/>
Pagination
import { Pagination } from "compo-v1";
export default function PaginationCompoEx(): JSX.Element | null {
const handleOptionChange = () => {
// Perform any necessary actions based on the selected option
};
return (
<Pagination options={6} onChange={handleOptionChange} />
)
}
Properties |
Type |
Default |
Description |
onChange |
function |
required |
Action performed on change |
options |
number[] or number |
required |
an array pagination Items |
Header
import { Header } from "compo-v1";
export default function HeaderCompoEx(): JSX.Element | null {
return (
<Header
type={"header"}
HeaderRight={
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Right
</Text>
}
HeaderMiddle={
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Label
</Text>
}
Headerleft={
<TouchableOpacity onPress={() => {}}>
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Left
</Text>
</TouchableOpacity>
}
/>
)
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of header |
Headerleft |
ReactNode |
optional |
any jsx element on left side of header |
HeaderMiddle |
ReactNode |
optional |
any jsx element on middle of header |
HeaderRight |
ReactNode |
optional |
any jsx element on right side of header |
containerStyle |
ViewStyle |
optional |
style to be applied on header container |
header
<Header
type={"header"}
HeaderRight={
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Right
</Text>
}
HeaderMiddle={
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Label
</Text>
}
Headerleft={
<TouchableOpacity onPress={() => {}}>
<Text
style={[
{
color: color.primarytext,
fontWeight: "600",
fontSize: 15,
lineHeight: 20,
},
]}
>
Left
</Text>
</TouchableOpacity>
}
/>
Import the necessary components and modules in your App.js file:
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { BottomTab } from "path of BottomBar component file ";
return (
<NavigationContainer>
<BottomTab />
</NavigationContainer>
);
```jsx
import { BottomBar } from "compo-v1";
export default function BottomBarExample(): JSX.Element | null {
const tabs = [
{
screen: Screen1,
icon: <Icon1 />,
label: "Tab 1",
},
{
screen: Screen2,
icon: <Icon2 />,
label: "Tab 2",
},
{
screen: Screen3,
icon: <Icon3 />,
label: "Tab 3",
},
];
return (
<BottomBar
type="bottomBar"
tabBarShowLabel={true}
BottomBarStyle={styles.bottomBar}
tabBarActiveTintColor="#FF0000"
tabBarInactiveTintColor="#808080"
tabBarIconStyle={styles.tabBarIcon}
tabBarLabelStyle={styles.tabBarLabel}
tabs={tabs}
/>
);
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of bottom bar |
tabBarShowLabel |
boolean |
optional |
Determines whether to show labels on the bottom bar tabs |
BottomBarStyle |
any |
optional |
Style to be applied to the bottom bar container |
tabBarActiveTintColor |
string |
optional |
Color of the active tab icon and label |
tabBarInactiveTintColor |
string |
optional |
Color of the inactive tab icons and labels |
tabBarIconStyle |
any |
optional |
Style to be applied to the tab icons |
tabBarLabelStyle |
any |
optional |
Style to be applied to the tab labels |
tabs |
array |
required |
Array of tab objects defining each tab's properties |
Properties |
Type |
Description |
screen |
React.ComponentType |
Component to render for the tab |
icon |
any |
Determines whether to show labels on the bottom bar tabs |
label |
string |
Label for the tab |
Import the necessary components and modules in your App.js file:
import React from "react";
import { ThemeProvider } from "compo-v1";
return (
<ThemeProvider>
// other components
</ThemeProvider>
);
import React, { useState } from "react";
import { AppTheme } from "compo-v1";
export default function AppThemeExample() {
const [theme, setTheme] = useState("light");
const handleThemeChange = (newTheme) => {
setTheme(newTheme);
};
return (
<AppTheme onThemeChange={handleThemeChange} />
);
}
import { Inputs } from "compo-v1";
export default function InputsCompoEx(): JSX.Element | null {
const [primaryVal, setPrimaryVal] = useState("");
return (
<Inputs
type="primaryInput"
placeholder="First Name"
inputLeft={
<Icon
name="IconUserCircle"
width={24}
height={24}
stroke={"#503374"}
/>
}
value={primaryVal}
onChangeText={(val) => setPrimaryVal(val)}
label="First Name"
/>
);
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of input |
value string |
optional |
Current value of the input |
|
placeholder |
string |
optional |
Placeholder text for the input |
onChangeText |
function |
optional |
Callback function to handle text input changes |
placeholderTextColor |
string |
optional |
Color of the placeholder text |
inputStyle |
StyleProp
|
optional |
Style to be applied to the input field |
inputLeft |
ReactNode |
optional |
Custom component to be rendered on the left side of the input field |
inputRight |
ReactNode |
optional |
Custom component to be rendered on the right side of the input field |
labelStyle |
any |
optional |
Style to be applied to the input label |
label |
string |
optional |
Label text for the input |
InputContainerStyle |
ViewStyle |
optional |
Style to be applied to the input container |
maxLength |
number |
optional |
Maximum number of characters allowed in the input |
options |
any |
optional |
Options for dropdown inputs |
onSelect |
any |
optional |
Callback function to handle dropdown option selection |
listStyle |
ViewStyle |
optional |
Style to be applied to the dropdown option list |
listTextStyle |
StyleProp
|
optional |
Style to be applied to the dropdown option list text |
<Inputs
type="searchInput"
placeholder="search"
inputLeft={
<Icon
name="IconSearchSm"
width={24}
height={24}
stroke={"#503374"}
/>
}
inputRight={
<TouchableOpacity onPress={() => setSearchVal("")}>
<Text>clean</Text>
</TouchableOpacity>
}
value={searchVal}
onChangeText={(val) => setSearchVal(val)}
/>
<Inputs
type="primaryInput"
placeholder="First Name"
inputLeft={
<Icon
name="IconUserCircle"
width={24}
height={24}
stroke={"#503374"}
/>
}
value={primaryVal}
onChangeText={(val) => setPrimaryVal(val)}
label="First Name"
/>
<Inputs
type="textBox"
placeholder="Description"
inputLeft={
<Icon
name="IconUserCircle"
width={24}
height={24}
stroke={"#503374"}
/>
}
value={textBoxVal}
onChangeText={(val) => setTextBoxVal(val)}
label="Description"
maxLength={300}
/>
<Inputs
type="secureInputField"
placeholder="Password"
value={secureVal}
onChangeText={(val) => setSecureVal(val)}
label="Password"
/>
<Inputs
type="largeDropDown"
onSelect={(value) => setSelectedValue(value)}
options={dummyData}
label={"DD field label"}
placeholder={"Placeholder"}
/>
<Inputs
type="smallDropDown"
onSelect={(value) => setSelectedValue(value)}
options={dummyData}
label={"DD field label"}
placeholder={"Placeholder"}
/>
import { ListItem } from "compo-v1";
export default function ListItemCompoEx(): JSX.Element | null {
const handleOptionChange = () => {
// Perform any necessary actions based on the selected option
};
return (
<ListItem
onPress={handleOptionChange}
title="Lg1"
value="value"
type="Lg1"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
ItemRight={
<Icon
name="rightArrowIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
);
}
Properties |
Type |
Default |
Description |
type |
string |
required |
Type of list item |
title |
string |
optional |
Title text for the list item |
value |
string |
optional |
Value text for the list item |
desc |
string |
optional |
Description text for the list item |
company |
string |
optional |
Company name for the list item |
project |
string |
optional |
Project name for the list item |
date |
string |
optional |
Date for the list item |
rupees |
string |
optional |
Rupees amount for the list item |
tags |
string or string[] |
optional |
Tags for the list item |
ItemLeft |
ReactNode |
optional |
Custom component to be rendered on the left side of the list item |
ItemRight |
ReactNode |
optional |
Custom component to be rendered on the right side of the list item |
onPress |
function |
optional |
Callback function to handle list item press |
containerStyle |
ViewStyle |
optional |
Style to be applied to the list item container |
titleStyle |
any |
optional |
Style to be applied to the title text of the list item |
valueStyle |
any |
optional |
Style to be applied to the value text of the list item |
descStyle |
any |
optional |
Style to be applied to the description text of the list item |
checkboxStyle |
ViewStyle |
optional |
Style to be applied to the checkbox component |
radioButtonStyle |
ViewStyle |
optional |
Style to be applied to the radio button icon component |
radioButtonSelectedStyle |
ViewStyle |
optional |
Style to be applied to the selected radio button component |
switchStyle |
ViewStyle |
optional |
Style to be applied to the switch component |
switchActiveColor |
string |
optional |
Active color for the switch component |
switchInactiveColor |
string |
optional |
Inactive color for the switch component |
<ListItem
onPress={handleOptionChange}
title="Lg1"
value="value"
type="Lg1"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
ItemRight={
<Icon
name="rightArrowIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
title="Lg2"
value="value"
desc="desc"
type="Lg2"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
ItemRight={
<Icon
name="rightArrowIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
title="Lr2"
value="value"
desc="desc"
type="Lr2"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
ItemRight={
<Icon
name="rightArrowIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
title="leftRadio"
value="value"
desc="desc"
type="leftRadio"
/>
<ListItem
onPress={handleOptionChange}
title="leftCheckbox"
value="value"
desc="desc"
type="leftCheckbox"
/>
<ListItem
onPress={handleOptionChange}
title="rightRadio"
value="value"
desc="desc"
type="rightRadio"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
title="rightCheckbox"
value="value"
desc="desc"
type="rightCheckbox"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
title="rightSwitch"
value="value"
desc="desc"
type="rightSwitch"
Itemleft={
<Icon
name="CheckIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
}
/>
<ListItem
onPress={handleOptionChange}
company={"company Name"}
project={"Project Name"}
date="01/01/24"
rupees={"000"}
tags={"Ol"}
type="kanbanPrimary"
ItemRight={
<TouchableOpacity onPress={() => {}}>
<Icon
name="DownIcon"
width={24}
height={24}
stroke={theme == "dark" ? "#ffffff" : "#503374"}
/>
</TouchableOpacity>
}
/>
import { TopTabBar } from "compo-v1";
export default function TopTabBarCompoEx(): JSX.Element | null {
const [activeTab, setActiveTab] = useState("Tab1");
return (
<TopTabBar
titles={["Tab1", "Tab2", "Tab3", "Tab4"]}
style={{ backgroundColor: "#FFFFFF", borderRadius: 20 }}
activeTab={activeTab}
onPressTab={(item) => {
setActiveTab(item);
setShowModal(true);
}}
activeTabText={{ color: "#005AE2" }}
styleText={{ color: "#000000" }}
containerStyle={{ backgroundColor: "#F3F3F3" }}
/>
);
}
Properties |
Type |
Default |
Description |
style |
StyleProp
|
optional |
Custom style for the active tab |
titles |
string[] |
required |
Array of titles for the tabs |
styleText |
StyleProp
|
optional |
Custom style for the tab text |
activeTab |
string |
required |
Currently active tab |
onPressTab |
function |
required |
Action performed when a tab is pressed |
activeTabText |
StyleProp
|
optional |
Custom style for the active tab text |
containerStyle |
StyleProp
|
optional |
Custom style for the container view |
import { BackgroundImage } from "compo-v1";
export default function BackgroundImageCompoEx(): JSX.Element | null {
return (
<BackgroundImage
BgImageSource={require("../assets/bgImage.jpg")}
style={{ marginVertical: 20, borderRadius: 16 }}
>
<View
style={{
flex: 1.5,
alignItems: "center",
justifyContent: "center",
}}
>
<Text
style={{
fontWeight: "800",
fontSize: 20,
lineHeight: 24,
color: "#ffffff",
}}
>
Jamie Curtis
</Text>
<Text
style={{
fontWeight: "400",
fontSize: 12,
lineHeight: 20,
color: "#ffffff",
}}
>
Followed by 326 Peers
</Text>
</View>
</BackgroundImage>
);
}
Properties |
Type |
Default |
Description |
BgImageSource |
ImageSourcePropType |
required |
Image source for the background image |
style |
ViewStyle |
optional |
Custom style for the component |
import { Modals } from "compo-v1";
export default function ModalExample(): JSX.Element | null {
const [showModal, setShowModal] = useState(true);
return (
<Modals
type="popUpModal"
showModal={showModal}
Icon={
<Icon
name="IconSearchSm"
width={24}
height={24}
stroke={"#503374"}
/>
}
modalDes={"Your modal description"}
onButtonPress={(button) => {
if (button?.buttonTitles === "Cancel") {
console.log("Cancel");
setShowModal(false);
}
if (button?.buttonTitles === "Okay") {
console.log("Okay");
setShowModal(false);
}
}}
button={[
{ buttonTitles: "Cancel", buttonTitlesColor: "red" },
{ buttonTitles: "Okay" },
]}
/>
)
}
Properties |
Type |
Default |
Description |
showModal |
boolean |
required |
Specifies whether the modal should be displayed or hidden. |
Icon |
ReactNode |
optional |
JSX element for the modal icon. |
modalDes |
string |
required |
Description text for the modal. |
onButtonPress |
function |
required |
Function to be called when a button is pressed. |
button |
ButtonItem[] |
required |
Array of button items to be displayed in the modal. |
modalStyle |
ViewStyle |
optional |
Style to be applied to the modal container. |
desTextStyle |
TextStyle |
optional |
Style to be applied to the modal description text. |
type |
string |
required |
Type of modal. |
popUpModal
<Modals
type="popUpModal"
showModal={showModal}
Icon={
<Icon
name="IconSearchSm"
width={24}
height={24}
stroke={"#503374"}
/>
}
modalDes={"Your modal description"}
onButtonPress={(button) => {
if (button?.buttonTitles === "Cancel") {
console.log("Cancel");
setShowModal(false);
}
if (button?.buttonTitles === "Okay") {
console.log("Okay");
setShowModal(false);
}
}}
button={[
{ buttonTitles: "Cancel", buttonTitlesColor: "red" },
{ buttonTitles: "Okay" },
]}
/>
import { ScreenLayout } from "compo-v1";
export default function ScreenExample(): JSX.Element {
return (
<ScreenLayout
statusBarColor="#ffffff"
transclucent={false}
scrollEnabled={false}
headerUnScrollable={() => null}
footerUnScrollable={() => null}
barStyle="dark-content"
containerStyle={styles.container}
type="primaryLayout"
>
{/* Your screen content */}
</ScreenLayout>
);
}
Properties |
Type |
Default |
Description |
statusBarColor |
string |
"#ffffff" |
The color of the status bar. |
transclucent |
boolean |
false |
Specifies whether the status bar should be translucent. |
scrollEnabled |
boolean |
false |
Specifies whether the screen content should be scrollable. |
headerUnScrollable |
function |
optional |
Function returning the header component that remains fixed and unaffected by scrolling. |
footerUnScrollable |
function |
optional |
Function returning the footer component that remains fixed and unaffected by scrolling. |
barStyle |
"default" or "light-content" or "dark-content" |
"dark-content" |
The style of the status bar. |
containerStyle |
ViewStyle |
optional |
Style to be applied to the screen container. |
type |
string |
required |
Type of screen layout. |
<ScreenLayout
type="primaryLayout"
scrollEnabled={true}
barStyle={"dark-content"}
statusBarColor="red"
containerStyle={{ backgroundColor: "#ffffff" }}
headerUnScrollable={() => (
<View
style={{
alignItems: "center",
paddingHorizontal: 10,
backgroundColor: "#ffffff",
}}
>
<Typography
type="LargeTitle1"
text={"fixed header"}
customStyle={{
color: color.primarytext,
fontSize: 20,
marginBottom: 10,
}}
/>
</View>
)}
footerUnScrollable={() => (
<FooterButton
type="singleFooterButton"
buttonTitle="fixed header"
disabled={!isChecked1}
customButtonStyle={{ backgroundColor: !isChecked1 ? "grey" : "blue" }}
/>
)}
>
{/* Your screen content */}
</ScreenLayout>