GithubHelp home page GithubHelp logo

React Retro UI Library

npm version npm license

React Retro UI Library is a retro-themed UI library for React that offers a unique set of over 20 components to help you effortlessly build nostalgic user interfaces. The library includes components such as buttons, containers, inputs, boxes, cards, text, modals, progress bars, chips, and alerts, among others.

There are also some unique components such as the MouseTrail component, which creates a trail of mouse cursors that follow the user's mouse movements, PixelatedImage, which pixelates an image, and many more. Additional components can be found in the demo.

The library is in it's early stages, so there are still many components to be added. Suggestions are always welcome, so feel free to open an issue here.

For detailed changes between versions, please refer to the github releases page. Stay tuned for frequent updates!

Demo

Explore the demo of the library to see all the components in action.

Installation

You can install the retro-react package using npm or yarn:

npm install retro-react

or

yarn add retro-react

Usage

You can import the components from the retro-react package and use them in your React application as follows:

import React from 'react';
import {
	Alert,
	Box,
	Button,
	Card,
	Chip,
	Container,
	Input,
	Modal,
	ProgressBar,
	Text,
} from 'retro-react';

const App = () => {
	return (
		<div>
			<Button>Click me</Button>
			<Container>{/* Your content here */}</Container>
			<Input placeholder="Enter text" />
			<Box>Box content</Box>
			<Card header="Header" footer="Footer">
				{/* Card content */}
			</Card>
			<Text variant="h1">Hello, world!</Text>
			<Modal open={true}>{/* Modal content */}</Modal>
			<ProgressBar value={50} />
			<Chip color="primary">Chip</Chip>
			<Alert open={true} color="success">
				{/* Alert content */}
			</Alert>
		</div>
	);
};

export default App;

Components

Please refer to the demo for a complete list of components and their props.

Global styles

Every component in React Retro UI has a retro-ui class name attached. This makes it easy to apply global styling to all components. For instance, you can change the font family of all components by adding the following CSS to your main stylesheet:

.retro-ui {
	font-family: 'Roboto', sans-serif !important;
}

sx prop

All components in React Retro UI support the sx prop, which allows you to add custom styles to the component. The sx prop accepts an object with CSS properties and values. For more information on the sx prop, please refer to the documentation.

<Button sx={{ backgroundColor: 'red' }}>Click me</Button>
<Text sx={{ color: 'blue' }}>Hello, world!</Text>
<Container sx={{ border: '1px solid black', width: '100vh' }}>{/* Your content here */}</Container>

Styling

Emotion is used for styling the components. You can create your own components by using the styled function from Emotion or use the theme values using the useTheme hook. For more information on styling, please refer to this documentation.

import React from 'react';
import { styled, useTheme } from 'retro-react';

const StyledButton = styled('button')`
	background-color: ${(props) => props.theme.colors.primary};
	color: ${(props) => props.theme.colors.white};
`;

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! People who want to contribute to this project can open an issue or submit a pull request here. If you are dedicated to contributing to this project, you can also contact me there.

retro-react's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.