Logo

dev-resources.site

for different kinds of informations.

Ship mobile apps faster with React-Native-Blossom-UI

Published at
1/12/2025
Categories
reactnative
uidesign
typescript
opensource
Author
deepak_kumar_dk
Author
15 person written this
deepak_kumar_dk
open
Ship mobile apps faster with React-Native-Blossom-UI

React-Native open-source community provides very few UI library which is also great, customizable and up to date. And I faced the same problem and so I decided to make a new one which will be rich in components and also provides a full customizability, that's where the blossom-ui comes in.

You can skip this article and directly run to the Documentation website.

Blossom UI helps you to create an awesome UI on mobile and web platform. It's based on custom design system and it's totally configurable.Main features that it provides -

Base components - This contains all the basic components that react-native provides.
Theme Support - Out of the box Theme support with dark theme.
Customizability - You can customize all the components to match to your UI need.
Icons Support - react-native-vector-icons support out of the box.

Installation

Start with installing the components library.

npm install @react-native-blossom-ui/components
Enter fullscreen mode Exit fullscreen mode

Next install the react-native-vector-icons as it's a peer dependency of the library.

Now wrap your Root Component (Navigation Container) into the BlossomThemeProvider in your App.ts file

import React, { useState } from "react";
import { BlossomThemeProvider } from "@react-native-blossom-ui/components";

import lightTheme from "../lightTheme.json";
import darkTheme from "../darkTheme.json";
import options from "../options.json";
import { MyAppContainer } from "src/navigation";

export default function App() {
  const [isDark, setIsDark] = useState(false);

  return (
    <BlossomThemeProvider
      theme={isDark ? darkTheme : lightTheme}
      isDark={isDark}
      options={options}
    >
      <MyAppContainer />
    </BlossomThemeProvider>
  );
}
Enter fullscreen mode Exit fullscreen mode

Now, from here you can use all the 20+ components (as of now) to build and awesome blossom UI.
Let's make a login form real quick.

import React, { useCallback, useState } from "react";

import {
  Button,
  Checkbox,
  Text,
  TextInput,
  View,
} from "@react-native-blossom-ui/components";

export function Login() {
  const [isLoading, setIsLoading] = useState(false);
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");

  const [isEmailError, setIsEmailError] = useState(false);
  const [isPasswordError, setIsPasswordError] = useState(false);

  const onLoginPress = useCallback(() => {
    if (!email) {
      setIsEmailError(true);
      return;
    }

    if (!password) {
      setIsPasswordError(true);
      return;
    }

    setIsEmailError(false);
    setIsPasswordError(false);
    // Call the api
    setIsLoading(true);
    setTimeout(() => {
      setIsLoading(false);
    }, 1500);
  }, []);

  return (
    <View style={{ margin: 16 }}>
      <Text typography="h4">Login</Text>
      <TextInput
        label="Email"
        placeholder="[email protected]"
        value={email}
        onChangeText={setEmail}
        containerStyle={{ marginVertical: 8 }}
        error={isEmailError ? "Please enter your email" : ""}
      />
      <TextInput
        label="Password"
        placeholder="Password"
        value={password}
        onChangeText={setPassword}
        containerStyle={{ marginVertical: 8 }}
        secureTextEntry
        error={isPasswordError ? "Please enter a valid password" : ""}
      />
      <Checkbox status="primary" size="small" label="Remember Me" />
      <Button
        isLoading={isLoading}
        title="Login"
        style={{ width: "100%", marginVertical: 16 }}
        onPress={onLoginPress}
      />
    </View>
  );
}
Enter fullscreen mode Exit fullscreen mode

Here's the result of it.

Image description

Bonus Component

You can also use the in-built Select/MultiSelect component which come out of the box with theme support too. For example -


export function SelectClearable() {
  const [selectedValue, setSelectedValue] = useState<number | undefined>(-1)

  return (
    <Select
      options={OPTIONS}
      value={selectedValue}
      clearable
      onValueChange={(value) => setSelectedValue(value)}
    />
  )
}
Enter fullscreen mode Exit fullscreen mode

Thanks for reading, please star this repository if it looks awesome and a good step in react-native community.

typescript Article's
30 articles in total
Favicon
Unique Symbols: How to Use Symbols for Type Safety
Favicon
Building bun-tastic: A Fast, High-Performance Static Site Server (OSS)
Favicon
Teaching Large Language Models (LLMs) to do Math Correctly
Favicon
Angular Addicts #33: NgRx 19, using the Page Object Model in tests, Micro Frontends using Vite & more
Favicon
Share the state of a hook between components
Favicon
Swapable React context without breaking Rules of Hooks and your neck
Favicon
Matanuska ADR 010 - Architecture, Revisited
Favicon
Building a Robust Color Mixing Engine: From Theory to Implementation
Favicon
Automating Limit Orders on Polygon with TypeScript, 0x, and Terraform
Favicon
The Magic of useCallback ✹
Favicon
Building a Secure Authentication API with TypeScript, Node.js, and MongoDB
Favicon
"yup" is the new extra virgin olive oil
Favicon
Dynamic Routes in Astro (+load parameters from JSON)
Favicon
TypeScript Discord Bot Handler
Favicon
Form-based Dataverse Web Resources with React, Typescript and FluentUI - Part 2
Favicon
Converting JPA entities to Mendix
Favicon
lodash._merge vs Defu
Favicon
React Native With TypeScript: Everything You Need To Know
Favicon
100 Days of Code
Favicon
Ship mobile apps faster with React-Native-Blossom-UI
Favicon
Import JSON Data in Astro (with Typescript)
Favicon
How to write unit tests and E2E tests for NestJS applications
Favicon
Matanuska ADR 009 - Type Awareness in The Compiler and Runtime
Favicon
How to Build an Image Processor with React and Transformers.js
Favicon
Building an AI-Powered Background Remover with React and Transformers.js
Favicon
Exploring TypeScript Support in Node.js v23.6.0
Favicon
Observing position-change of HTML elements using Intersection Observer
Favicon
Breweries App
Favicon
Using LRU Cache in Node.js and TypeScript
Favicon
Build a Mac Tool to Fix Grammar Using TypeScript, OpenAI API, and Automator

Featured ones: