Cyberfuture
Times change and apps need to adapt to those changes
The Cyberfuture package provides several components for React that can be used to quickly and easily create styled user interfaces.
All of these components can be customized using CSS variables or by passing in props to modify their appearance.
By using the Cyberfuture package, developers can save time and effort when building user interfaces. The purpose is to create more visually appealing and engaging experiences for users.
CyberButton Component
The CyberButton component is a customizable button with an animated clip-path effect. It receives a text prop, which sets the text that appears inside the button.
Props
Prop | Type | Required | Default | Description |
---|---|---|---|---|
text | string | Yes | - | The text that appears inside the button. |
import { CyberButton } from 'cyberfuture';
function App() {
return (
<div>
<CyberButton text="Click me!" />
</div>
);
}
Customization
The CyberButton component can be customized by modifying the following CSS variables:
CSS Variable | Default Value | Description |
---|---|---|
--cyber-button-color | #fff | The text color of the button. |
--cyber-button-background | linear-gradient(106deg, #ffe900 8%, #0043ff 44%, #a200ff 87%) | The background of the button. |
--cyber-button-background-noise1 |
keyframes animation |
The first noise animation of the button background. |
--cyber-button-background-noise2 |
keyframes animation |
The second noise animation of the button background. |
.Cyber-green-button {
--cyber-button-color: #000;
--cyber-button-background: linear-gradient(106deg, #ff296d 8%, #8e52f5 44%, #95f11c 87%);
}
Additional Notes
The CyberButton component is part of a larger theme object that contains additional colors and text styles. These can be used to further customize the component and the app as a whole.
Card Component
A styled card component with customized styles and responsive layout. It includes a title, a body, and a footer, and can be used in various scenarios such as displaying product information or showcasing team members.
Usage
import { Card } from "cyberfuture";
<Card
title="Card Title"
body={<div>Card Body</div>}
end={<div>Card Footer</div>}
variant="Matrix"
background="#333333"
/>
Props
-
title
: Title of the carousel (required). -
body
: Body of the carousel, not used in this variant. -
end
: Footer of the carousel, can be any valid JSX element. -
CardBody
: A required prop to be used with theCardCarousel
variant, renders a carousel of cards with this element as a template. -
variant
: A prop used to customize the colors of the cards. It must be"Matrix"
,"Rose"
,"Punk"
, or"Gold"
. -
background
: Background color of the carousel. If not provided, a default color ofrgba(17, 25, 40, 0.75)
will be used. -
width
: Width of the carousel in CSS units. Default iscalc(350px - 2vmin)
. -
height
: Height of the carousel in CSS units. Default is30em
.
CardCarousel Component
This is a variation of the Card component that includes a horizontal carousel with body items.
Usage
import { CardCarousel } from "cyberfuture";
<CardCarousel
title="Carousel Title"
end={<div>Carousel Footer</div>}
variant="Matrix"
background="#333333"
/>
Props
-
title
: The title of the card (string, required). -
end
: The content of the card footer (React node). -
variant
: The variant of the card style (string, required). It can be one of these:"Matrix"
,"Rose"
,"Punk"
,"Gold"
-
background
: The background color of the card. Default is rgba(17, 25, 40, 0.75).
Usage
<CardCarousel
title="My Carousel Title"
CardBody={<p>Some text here</p>}
variant="Matrix"
background="#00FF00"
/>
CyberInput Component
The CyberInput component is a reusable React input component with an optional label. It renders an HTML input element with a label when the label prop is provided.
Props
The component accepts the following props:
-
type
: This is the type of the input element, such as "text", "password", etc (string, optional, default "text"). -
label
: This is the label that will be displayed for the input element (string, optional). -
value
: The value of the input element (string).
Example Usage
import React, { useState } from "react";
import { CyberInput } from "cyberfuture";
const MyForm = () => {
const [username, setUsername] = useState("");
const handleUsernameChange = (event) => {
setUsername(event.target.value);
};
return (
<form>
<CyberInput
type="text"
label="Username"
value={username}
onChange={handleUsernameChange}
/>
</form>
);
};
In this example, the CyberInput component is used inside a form. The type prop is set to "text", the label prop is set to "Username", and the value prop is set to the value of the username state variable. The onChange prop is also provided to handle changes in the input element.