Skip to main content

Theme & Customization

Let us start by learning about the most basic supermod - react-sf-themes. Use the react-sf-themes supermod to access the global configuration and the default theme provided by Superflows.

react-sf-themes

Use the react-sf-themes supermod to access the global configuration & default theme provided by Superflows. Then customize it further by changing the default values to suit your UI.

How It Works

Customization works as follows:

  • Access the default configuration and theme values using this supermod
  • Modify them as per your requirement
  • Pass the modified object down to your other supermods

Theme

This supermod provides default values for:

  • Variants
  • Types
  • Colors
  • Spaces
  • Modes
  • InputTypes
  • Breakpoints

Variants

Superflows provides the following variants:

  • Primary
  • Secondary
  • Danger
  • Success
  • Warning
  • Info
  • Light
  • Dark

Types

Types are as followed:

  • Filled
  • Outlined

Colors

Following colors are provided:

VariantBackground ColorText Color
Primary#0d6efd#ffffff
Secondary#6c757d#ffffff
Danger#dc3545#ffffff
Success#198754#ffffff
Warning#ffc107#000000
Info#0dcaf0#000000
Light#f8f9fa#000000
Dark#212529#ffffff

Spaces

Spaces are dimensions, which are intended to be used for spacings, paddings, margins, etc.

SpaceValue
min5
ltl10
mod15
big20
lrg25
xlg30
max35

Dimensions

Dimensions are default dimensions for certain Superflows components

SpaceValue
navHeight30
navBannerHeight50
menuWidth120
notificationListWidth200
notificationListMaxHeight400

Modes

Modes are:

ModeValue
Dayday
Nightnight

InputTypes

Input types are types of input accepted from the users in the input field.

InputTypeValue
Namename
Emailemail
Mobilemobile
Datedate
DateOfBirthdateOfBirth
Gendergender
SearchStringsearchString

Breakpoints

Breakpoints are widths, that are used in responsive design.

BreakpointValue
mobile480
tablet768
laptop1024
desktop1200

Quickstart

Installation

npm install --save react-sf-themes

Usage

import React from 'react'
import Themes from 'react-sf-themes'

const App = () => {

console.log('Theme', Themes.getTheme());

return <div></div>
}

export default App