0.5.0 • Published 2 years ago
layouts-rc v0.5.0
Layouts-rc
React component library for layouts.
Inspired by flutter layout widgets.(link)
- Typesafe
- with tailwindcss - 👌
- with CSS in js - 👌
- with css-modules - 👌
Install
npm install layouts-rcStyle apply
import 'layouts-rc/styles.css'; // top
import './globals.css';Usage
import {
SlotBaseComp,
Scaffold,
ScaffoldHeader,
ScaffoldBody,
ScaffoldFooter,
Row,
Column,
Center,
} from 'layouts-rc';SlotBaseComp
slot: DOCS
<SlotBaseComp asChild>
<button>button</button>
</SlotBaseComp>
// or
<SlotBaseComp as={"button"}>button</SlotBaseComp>Rest Component (Scaffold, Column, Row, Center)
Props
Common props
| Prop | Type | Default |
|---|---|---|
| as | string | "div" |
| asChild | boolean | - |
Row & Column Component props
| Prop | Type | Default |
|---|---|---|
| gap | string|number | - |
| justify | css(justifyContent) | - |
| items | css(alignItems) | - |