GithubHelp home page GithubHelp logo

sakura90 / react-word-section Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 545 KB

react-word-section gives multiple UI representations of a word section that has a subject followed by the text content.

CSS 31.35% TypeScript 68.65%
react npm react-component text section reactui

react-word-section's Introduction

react-word-section

This library gives developers other appropriate options of displaying a word section represented by a subject following the content of the text information in addition to simply displaying a subject on top of the text content.

This library gives 6 ways of displaying a section of text.

Common

The subject text is larger than the content text.

PC:

Mobile:

Vertical Line

On top of the common style, a vertical line is added to the left of the subject text.

PC:

Mobile:

Underline

On top of the common style, an underline is added to the bottom of the subject text.

PC:

Mobile:

Background Color

On top of the common style, the subject text block has a background color.

PC:

Mobile:

Bold

On top of the common style, the subject text is in bold.

PC:

Mobile:

Block Corner Round

On top of the common style, a lightgrey background color is added to the text block that has the subject and the content, and the block corner becomes round.

PC:

Mobile:

Installation

$ npm install --save react-word-section

Usage

Here's a sample implementation that creates a word section on a dummy Create-React-App page.

import React from 'react';
import WordSection from 'react-word-section';

function App() {
  const subject = 'Retailers Embrace AI Tech for Improved Customer Experience';
  const content = 'Artificial Intelligence is becoming commonplace across major industries and retail is no exception.The retail industry is looking for ways to keep up with the times and many companies have started implementing AI technology across the entire product and service cycle โ€“ from assembly to post-sale customer service interactions.';
  
  return (
    <>
      <WordSection 
        subject={subject}
        subjectStyle='common'
        background='white'
        corner='sharp'
      >
        {content}
      </WordSection>      
    </>
  );
}

export default App;

Options


Option Type Required Default Description
subject String Yes N/A Subject text
subjectStyle String No common Subject text UI style. common, verticalLine, underline, backgroundColor, or bold
background String No white Background color of the section. white or lightgrey
corner String No sharp Corner appearance of the section block. sharp or round

Demo

CodeSandbox

react-word-section's People

Contributors

sakura90 avatar

Watchers

 avatar  avatar

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.