Skip to content

A set of React components that make it easy to style elements using props.

Notifications You must be signed in to change notification settings

steadicat/stylistic-elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stylistic Elements

A set of React components that make it easy to style elements using props.

For example:

import {Element} from 'stylistic-elements';

<Element
  tag="input"
  type="text"
  id="myElement"
  onClick={onClickHandler}
  marginTop={12}
  translateY={24}
/>

// Renders as:

<input
  type="text"
  id="myElement"
  onClick={onClickHandler}
  style={{
    marginTop: 12,
    transform: 'translate(0, 24px)',
  }}
/>

Available elements

  • Element: the most basic one, simply converts props into inline styles. I recommend using one of the higher-level components below instead.
  • ResetElement: like Element but resets some common user-agent styles to their defaults.
  • Block: a block-level element. Defaults to div.
  • Inline: an inline element. Defaults to span.
  • InlineBlock: an inline-block element. Defaults to a div with display: inline-block and vertical-align: middle.

Supported attributes

See stylistic for the list of supported attributes.

About

A set of React components that make it easy to style elements using props.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published