flex-layout-system
Advanced tools
Comparing version
@@ -40,3 +40,3 @@ { | ||
], | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Flex Layout", | ||
@@ -43,0 +43,0 @@ "name": "flex-layout-system", |
123
README.md
@@ -1,6 +0,30 @@ | ||
# Introducing Flex Layout System v2: Simplifying Responsive Web Design | ||
# Flex Layout System v2: Effortless Responsive Design | ||
Flex Layout System v2 is a streamlined library of web components designed to make responsive web design effortless. This new version brings several improvements, including a reduced number of components, built-in responsiveness, and no external stylesheets—everything is neatly packaged within the components themselves. | ||
**Effortlessly create dynamic, responsive grids with minimal code.** | ||
**Why Flex Layout System?** | ||
- **Built-in Responsiveness:** Predefined breakpoints (`xs, sm, md, lg, xl, xxl`) – no media queries needed. | ||
- **Customizable Breakpoints:** Adjust `DEFAULT_MEDIA_SIZES` to fit your unique design requirements. | ||
- **Self-Contained Styling:** All styles are encapsulated inside components – clean, consistent, and portable. | ||
- **Framework Agnostic:** Works seamlessly in plain HTML, Angular, Next.js, and more. | ||
- **Intuitive and Simple:** Write familiar HTML-like syntax and get powerful layouts out of the box. | ||
**Quick Example:** | ||
```html | ||
<flex-canvas w="1200px"> | ||
<flex-grid gap="50px, xs 10px, sm 20px, md 40px"> | ||
<flex-box center wrap dn="row, xs column"> | ||
<flex-cell w="50%, sm 100%"> | ||
<s-box center bgc="red" pd="20px, sm 10px">Box 1</s-box> | ||
</flex-cell> | ||
<flex-cell w="50%, sm 100%"> | ||
<s-box center bgc="green" pd="20px, sm 10px">Box 2</s-box> | ||
</flex-cell> | ||
</flex-box> | ||
</flex-grid> | ||
</flex-canvas> | ||
``` | ||
[](https://flexlayout.com/) | ||
@@ -10,17 +34,66 @@ [](https://www.npmjs.com/package/flex-layout-system) | ||
## Responsive Design Made Easy | ||
## Key Features | ||
Flex Layout System v2 is built with responsiveness at its core. You don’t need to write media queries or fiddle with CSS—everything is managed directly through attributes. | ||
- **Simplified Components**: The number of components has been significantly reduced, making them more intuitive and powerful. Each component is thoughtfully designed to cover a wide range of use cases. | ||
- **Built-in Responsiveness**: Components now include built-in responsive behavior, eliminating the need for additional media queries or breakpoints. | ||
- **Self-contained Styles**: All styles are encapsulated within the components, ensuring consistency and reducing the need for external CSS files. | ||
- **Framework Agnostic**: Flex Layout System v2 is compatible with any framework or project, whether you're using React, Angular, or plain HTML/JS. | ||
### Breakpoints | ||
## Get Started | ||
The system supports six predefined breakpoints: | ||
### Browser / Compiled Version / Source Web Components | ||
- **`xs`**: Extra small (default: 0–600px) | ||
- **`sm`**: Small (default: 601–900px) | ||
- **`md`**: Medium (default: 901–1200px) | ||
- **`lg`**: Large (default: 1201–1440px) | ||
- **`xl`**: Extra large (default: 1441–1920px) | ||
- **`xxl`**: Ultra large (default: 1921px and above) | ||
1. **Installation**: | ||
Install the Flex Layout System package via npm: | ||
### How It Works | ||
Simply define responsive values for your attributes, separated by commas, and the library will handle the rest. For example: | ||
```html | ||
<flex-grid gap="50px, xs 10px, sm 20px, md 40px"> | ||
<flex-box dn="row, xs column"> | ||
<flex-cell w="50%, sm 100%"> | ||
<s-box pd="20px, sm 10px">Responsive Box</s-box> | ||
</flex-cell> | ||
</flex-box> | ||
</flex-grid> | ||
``` | ||
- gap: Adjusts the spacing between grid items for different screen sizes. | ||
- dn (direction): Switches from row to column layout on small screens (xs). | ||
- w (width): Changes cell width to 100% on smaller screens (sm). | ||
and more... See the [documentation](https://flexlayout.com/docs) for a full list of attributes. | ||
### Custom Breakpoints | ||
Need specific breakpoints? Customize them globally using **DEFAULT_MEDIA_SIZES**: | ||
```js | ||
window.DEFAULT_MEDIA_SIZES = { | ||
xs: 500, // Extra small screens | ||
sm: 800, // Small screens | ||
md: 1100, // Medium screens | ||
lg: 1400, // Large screens | ||
xl: 1800, // Extra large screens | ||
xxl: 2400, // Ultra large screens | ||
}; | ||
``` | ||
This allows you to align the breakpoints with your unique design needs, and all responsive attributes will automatically adapt to your configuration. | ||
### Why It’s Powerful | ||
- **No Extra CSS**: Responsive logic is baked directly into your components. | ||
- **Consistency**: Predefined breakpoints ensure layouts look great across all devices. | ||
- **Customizability**: Adjust breakpoints once, and the entire layout adapts globally. | ||
- **Ease of Use**: Declare responsive values directly in your markup, no coding required. | ||
- **With Flex Layout System**, responsiveness is not an afterthought—it’s seamless and effortless. | ||
## Get Started ### Browser / Compiled Version / Source Web Components 1. | ||
**Installation**: Install the Flex Layout System package via npm: | ||
```bash | ||
@@ -56,3 +129,3 @@ npm install flex-layout-system | ||
```js | ||
"use client"; | ||
"use client"; | ||
@@ -66,3 +139,3 @@ import "flex-layout-system/jsx.types.d"; // Import JSX types | ||
<span>2</span> | ||
</flex-box> | ||
</flex-box>; | ||
``` | ||
@@ -80,3 +153,6 @@ | ||
<> | ||
<Script src="https://unpkg.com/flex-layout-system/dist/browser.min.js" strategy="lazyOnload" /> | ||
<Script | ||
src="https://unpkg.com/flex-layout-system/dist/browser.min.js" | ||
strategy="lazyOnload" | ||
/> | ||
<flex-box jc="space-between"> | ||
@@ -116,22 +192,10 @@ <span>1</span> | ||
## Components Overview | ||
## Conclusion | ||
Here’s a brief overview of the key components available in Flex Layout System v2: | ||
- **`flex-canvas`**: The primary container component, used to manage the overall dimensions of the layout. It serves as the foundational wrapper in which other components, like `flex-grid` or `flex-box`, can be nested. | ||
- **`flex-grid`**: The main container for creating grid-based layouts. It allows you to define a grid with customizable spacing between grid cells, providing a structured and organized layout. | ||
- **`flex-box`**: A flexible container component designed to manage flexbox logic. It controls the alignment, direction, wrapping, and spacing of its child elements, making it ideal for responsive layouts within the grid. | ||
- **`flex-cell`**: The building blocks within the `flex-grid`. These are individual cells that make up the grid structure, and they can be customized for size, order, and alignment to fit various layout needs. | ||
- **`flex-media`**: A specialized component that monitors the size of a local container and adjusts its content accordingly. It's particularly useful for creating responsive designs that adapt to different screen sizes or container dimensions. | ||
- **`d-box`**: A dynamic box that adapts its display properties based on media queries, allowing for flexible and responsive content presentation. | ||
- **`space-box`**: A component for adding controlled spacing within layouts. It offers options for stretching and setting specific dimensions, making it easy to manage empty spaces or gaps. | ||
- **`s-box`**: A versatile box component that provides extensive styling and layout control. It includes options for text alignment, padding, margins, and more, making it a flexible tool for fine-tuning the design. | ||
## Conclusion | ||
Flex Layout System v2 is a powerful tool for web developers, making it easier than ever to create responsive, clean, and maintainable layouts. With a reduced number of components and built-in styling, it's designed to fit seamlessly into any project or framework. | ||
Flex Layout System v2 redefines layout design for modern web developers, offering a streamlined, responsive, and highly maintainable solution. With fewer components, built-in styling, and intuitive responsiveness, it seamlessly integrates into any project or framework, enabling you to build sophisticated layouts effortlessly. | ||
For more information and examples, visit the [official website](https://flexlayout.com). | ||
Explore more features, examples, and documentation on the [official website](https://flexlayout.com). | ||
## Developer | ||
@@ -144,2 +208,1 @@ | ||
This project was developed by **unbywyd**. | ||
223967
0.3%203
45%