All Projects → moarwick → react-super-styled

moarwick / react-super-styled

Licence: other
Responsive JSX layouts with Styled Components

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-super-styled

griding
🧱 lean grid & responsive for react
Stars: ✭ 18 (-76.62%)
Mutual labels:  grid, responsive, layout, react-component
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+2718.18%)
Mutual labels:  grid, responsive, layout
bootstrap-grid-ms
Missing grid range in Bootstrap 3, micro-small from 480-767px.
Stars: ✭ 34 (-55.84%)
Mutual labels:  grid, responsive, layout
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+2600%)
Mutual labels:  grid, responsive, layout
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (+0%)
Mutual labels:  grid, responsive, layout
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (+379.22%)
Mutual labels:  grid, responsive, layout
Flex Layout
Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API
Stars: ✭ 5,705 (+7309.09%)
Mutual labels:  grid, responsive, layout
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (+23.38%)
Mutual labels:  grid, responsive, layout
Popo
PoPo is the grid layout tool, the best choice for runtime layout.
Stars: ✭ 130 (+68.83%)
Mutual labels:  grid, layout
Gridextra
Custom panel controls for WPF/UWP.
Stars: ✭ 149 (+93.51%)
Mutual labels:  grid, responsive
Angular Grid Layout
Responsive grid with draggable and resizable items for Angular applications.
Stars: ✭ 163 (+111.69%)
Mutual labels:  grid, responsive
Greedo Layout For Android
Full aspect ratio grid LayoutManager for Android's RecyclerView
Stars: ✭ 1,588 (+1962.34%)
Mutual labels:  grid, layout
The Grid
Grid layout custom element with drag and drop capabilities
Stars: ✭ 122 (+58.44%)
Mutual labels:  grid, layout
React Awesome Styled Grid
A responsive 8-point grid system layout for React using styled-components
Stars: ✭ 157 (+103.9%)
Mutual labels:  grid, responsive
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (+55.84%)
Mutual labels:  grid, responsive
Stack Up.js
Create fixed width, variable height grid layouts.
Stars: ✭ 117 (+51.95%)
Mutual labels:  grid, layout
Muuri React
The layout engine for React
Stars: ✭ 163 (+111.69%)
Mutual labels:  grid, layout
react-notification-alert
React bootstrap 4 notification alert
Stars: ✭ 34 (-55.84%)
Mutual labels:  responsive, react-component
vue-grid-responsive
Responsive grid system based on Bootstrap for Vue
Stars: ✭ 27 (-64.94%)
Mutual labels:  grid, responsive
Styled Bootstrap Components
The bootstrap components made with styled-components 💅
Stars: ✭ 196 (+154.55%)
Mutual labels:  grid, layout

React Super Styled

RSS

style: styled-components js-standard-style

Responsive JSX layouts with Styled Components

Try the DEMO

RSS is a small React component library which aims to accelerate authoring of JSX layouts and improve their readability:

  • Semantic component and prop naming
  • Handy boolean props for common styling rules
  • Media breakpoint support for styles, grid, and display (show/hide)
  • Flexbox and flex-based grid (arbitrary columns)
  • Spacing "shorthands" for margin, padding
  • Customizable theme, breakpoints
  • Plus: A highly-configurable SVG icon wrapper, utilities

Some breaking "improvements" in 0.5.0, 0.7.0 -- see Releases

Installation

npm install react-super-styled --save

or

yarn add react-super-styled

Your React project should be using Styled Components v4.0+ as a dependency. If not, install it.

Usage Example

import { css } from 'styled-components';
import { Article, Heading, Text } from 'react-super-styled'

function MyArticle({ text, title }) {
  return (
    <Article margin="1rem 0" styles={{ md: css`padding: 2rem` }}>
      <Heading center color="firebrick" large>{title}</Heading>
      <Text italic">{text}</Text>
    </Article>
  )
}

Interactive Docs

Try out React Super Styled "live" in the DEMO. The intent behind RSS is to be intuitive and readable. Experiment with all listed props and inspect the results! :)

RSS is intended for building layouts, prioritizing dev speed and code readability. Dynamic prop parsing adds some "overhead", so RSS may be inappropriate for complex components requiring lots of custom styling, ultra dense layouts, tables, recursive or iterative applications, or whenever maximum performance is critical. Don't build Reddit with it! :)

Responsive

Nearly all RSS components accept a styles prop, with responsive support. Styles can be passed in as a basic string of CSS, e.g. "color: red; font-size: 2rem" or an array of CSS interpolations from Styled Components' css helper. To specify styles per breakpoint, pass in an object with any of the following supported breakpoint keys:

styles = {{ xs: "...", sm: "...", md: "...", lg: "...", xl: "..." }}

Grid

The Flex (container) and FlexItem components support all valid Flexbox props, plus an arbitrary-sized grid implementation.

FlexItem supports col and an optional offset, expecting width values as decimal percentages 0 - 1. For instance, a third of a 12-column grid, offset to the center:

<FlexItem col={ 4/12 } offset={ 4/12 }>
    Column Content
</FlexItem>

Flex accepts an optional gutter, which is passed down to any direct FlexItem children. Gutters are specified in rems (default) or other valid units, e.g. px. If specified, negative margins are applied to the Flex container to ensure flush alignment of the outer FlexItem columns with the container.

As with styles, the grid props will also accept object values, per breakpoint:

<FlexItem col={{ xs: 12/12, md: 6/12 }} offset={{ xs: 0, md: 3/12 }}>
    Column Content
</FlexItem>

Spacing Shorthands

Web layouts involve frequent tweaking of margins and padding, so most RSS components accept "shorthand" margin and padding props. Passing in numbers defaults to rem units.

Typography

The RSS theme does not come with any predefined font sizing. You can specify browser-interpreted sizing, e.g. small, medium (matches 100%), large, xLarge, xxLarge, as well as relative sizing & weights, e.g. smaller, larger, lighter, bolder. Explicit sizing can be set via the size prop, which accepts numbers (rem) or strings with any valid units.

Per "best practices", it's recommended to use rems. Setting the following resets on your document tends to work well, establishing 1rem as 10px:

html { font-size: 62.5%; }   // 1rem
body { font-size: 1.4rem; }  // ~14px

Theme

RSS components rely on a built-in default theme. Being a layout-oriented library, the theme is "design neutral" and contains primarily (Bootstrap compatible) breakpoint values.

Should you want to override any of those values, you can pass in your own theme (or a subset thereof) to any RSS component directly via the theme prop. Using Styled Components' ThemeProvider wrapper should also work. The passed-in theme will be "extended over" the defaults, so it can be used to override existing values or to add more variables in case you decide to extend any RSS components further.

Extending Styling

Majority of RSS components are functional native Styled Components, so their styling can be extended further using the styled(Component) constructor. As of SC v4, you can also pass in a tag name via the "as" prop.

Changelog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].