1.1.5 • Published 3 months ago

eclipse-mobile-components v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

eclipse-mobile-components


Eclipse Mobile Components are crafted for developers who prioritise quick prototyping without compromising on usability. Our components offer a minimalistic yet detailed approach, providing an alternative to the out-of-the-box React Native components which may not always meet the rapid development needs. Perfect for those looking to swiftly bring their app ideas to life, specifically made for JS/TS Expo on iOS and Android platforms.

PrimaryButton

A customisable button component, offering flexibility in size, colour, and styling.

Props

PropTypeOptionalDefaultDescription
titlestringNoThe text displayed on the button.
onPressfunctionNoCallback function to execute when the button is pressed.
size"small" | "large"Yes"small"Predefined button sizes.
backgroundColourstringYesPredefined colourThe background colour of the button.
textColourstringYesThe colour of the button text.
borderRadiusnumberYesPredefined valueThe border radius of the button.
borderWidthnumberYesPredefined valueThe border width of the button.
textStyleobjectYesCustom style object for the button text.
widthnumber | nullYesCustom width for the button.
heightnumber | nullYesCustom height for the button.

Usage Example

import { PrimaryButton } from "eclipse-mobile-components";

<PrimaryButton
  title="Press Me"
  onPress={() => alert("Button Pressed")}
  size="large"
  backgroundColour="#007bff"
  textColour="#ffffff"
/>;

Visual Example

PrimaryButton


TextField Component

A customisable text input component, offering a wide range of styling options.

Properties

PropertyTypeOptionalDefaultDescription
valueanyNoThe current value of the text input.
setterFunctionNoFunction to update the value based on user input.
placeholderstringYesPlaceholder text displayed when the input is empty.
textStyleObjectYesCustom style for the text within the input.
textSizenumberYesSize of the text within the input.
widthnumberYesCustom width for the input field.
heightnumberYesCustom height for the input field.
inputColourstringYesdefaultInputColourColour of the input text.
borderRadiusnumberYesdefaultBorderRadiusBorder radius for the input field.
borderWidthnumberYesdefaultBorderWidthBorder width for the input field.
backgroundColourstringYesdefaultTextFieldColourBackground colour of the input field.

Usage Example

import React, { useState } from "react";
import { TextField } from "eclipse-mobile-components";

const MyComponent = () => {
  const [text, setText] = useState("");

  return (
    <TextField
      value={text}
      setter={setText}
      placeholder="Enter something..."
      textSize={16}
      backgroundColour="#fff"
      inputColour="#333"
    />
  );
};

Visual Example

TextField


TabSystem Component

The TabSystem offers a flexible and interactive means to display content in a tabulated format.

Properties

PropertyTypeOptionalDescription
tabOneTitlestringNoTitle for the first tab.
tabTwoTitlestringNoTitle for the second tab.
tabOneContentReact.ReactNodeNoContent displayed when the first tab is active.
tabTwoContentReact.ReactNodeNoContent displayed when the second tab is active.
heightnumberYesOptional height for the content container.
widthnumberYesOptional width for the content container.

Usage Example

import React from "react";
import { TabSystem } from "eclipse-mobile-components";
const App = () => (
  <TabSystem
    tabOneTitle="Tab 1"
    tabTwoTitle="Tab 2"
    tabOneContent={<Text>Content for Tab 1</Text>}
    tabTwoContent={<Text>Content for Tab 2</Text>}
    height={300}
  />
);
export default App;

Visual Example

TabSystem


CustomWarning Component

A modal component designed for displaying warnings or messages with customisable options.

Properties

PropertyTypeOptionalDescription
visiblebooleanNoControls the visibility of the modal.
messagestringNoThe message or content displayed inside the modal.
onClosefunctionNoFunction to call when attempting to close the modal.
titlestringNoThe title displayed at the top of the modal.
buttonTwoTitlestringYesTitle for an optional second button.
buttonTwoOnClickfunctionYesCallback for the optional second button.

Visual Example

import { CustomWarning } from "eclipse-mobile-components";
import { useState } from "react";

export default function App() {
  const [modalVisible, setModalVisible] = useState(false);
  return (
    <CustomWarning
      visible={modalVisible}
      title="Warning"
      buttonOneTitle="Button A"
      message="This is a detailed warning message."
      onClose={() => setModalVisible(false)}
      buttonTwoTitle="Button B"
      buttonTwoOnClick={() => console.log("Second action taken")}
    />
  );
}

Visual Example

CustomWarning


CustomAvatar Component

A customisable avatar component with an optional badge indicator.

Properties

PropertyTypeOptionalDescription
imageSourceImageSourcePropTypeNoSource of the avatar image.
badgeCountnumber | stringYesContent of the badge. Can be used for notification counts.
sizenumberYesCustom size for the avatar's diameter.
badgeSizenumberYesCustom size for the badge's diameter.

Usage Example

import React from "react";
import { CustomAvatar } from "eclipse-mobile-components";

const UserProfile = () => (
  <CustomAvatar
    imageSource={{
      uri: "https://images.pexels.com/photos/428361/pexels-photo-428361.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
    }}
    badgeCount="9+"
    size={100}
    badgeSize={25}
  />
);

Visual Example

CustomAvatar


AccordionSection Component

A versatile accordion component, allowing content to be expanded and collapsed.

Properties

PropertyTypeOptionalDescription
titlestringNoThe title displayed on the accordion header.
childrenReact.ReactNodeNoThe content to be shown when the accordion is expanded.
widthnumberYesOptional width for the accordion, defaulting to the screen's width.

Usage Example

import React from "react";
import { AccordionSection } from "eclipse-mobile-components";

const App = () => {
  return (
    <AccordionSection title="Section Title">
      <Text>Content goes here.</Text>
    </AccordionSection>
  );
};

Visual Example

CustomAccordionSection_Close CustomAccordionSection_Open


CustomModal Component

A flexible modal component, enabling customised presentation layers.

Properties

PropertyTypeOptionalDescription
showModalbooleanNoControls the visibility of the modal.
childrenReact.ReactNodeNoThe content rendered within the modal.
containerStyleobjectYesCustom style for the modal's container.
contentStyleobjectYesCustom style for the modal's content.
borderWidthnumberYesCustom border width for the container.
borderRadiusnumberYesCustom border radius for the container.
borderColorstringYesCustom border colour for the container.

Usage Example

import React from "react";
import { CustomModal } from "eclipse-mobile-components";

const App = () => (
  <CustomModal
    showModal={true}
    borderWidth={2}
    borderRadius={10}
    borderColor="grey"
    containerStyle={{ backgroundColor: "rgba(0,0,0,0.5)" }}
    contentStyle={{ backgroundColor: "white" }}
  >
    <View style={{ width: 300, height: 100 }}>
      <Text>Modal Content Goes Here</Text>
    </View>
  </CustomModal>
);

Visual Example

CustomModal


1.1.5

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.1.4

3 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago