flex-layout-system
Advanced tools
Comparing version
@@ -40,3 +40,3 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Flex Layout", | ||
@@ -43,0 +43,0 @@ "name": "flex-layout-system", |
@@ -5,2 +5,8 @@ # Introducing Flex Layout System v2: Simplifying Responsive Web Design | ||
[](https://flexlayout.com/) | ||
[](https://www.npmjs.com/package/flex-layout-system) | ||
[](https://flexlayout.com/docs) | ||
## Key Features | ||
@@ -39,27 +45,45 @@ | ||
1. **Client-side Import**: | ||
For Next.js, add "use client"; at the top of your component file: | ||
To use this library in your Next.js project: | ||
```js | ||
"use client"; | ||
1. Install the package: | ||
```bash | ||
npm install flex-layout-system | ||
``` | ||
2. **Import Types and Components**: | ||
Import the types and components for use in JSX: | ||
2. In your component file, add "use client" at the top: | ||
```js | ||
"use client"; | ||
import "flex-layout-system/jsx.types.d"; // Import JSX types | ||
import "flex-layout-system"; // Import components | ||
``` | ||
3. **Use Components**: | ||
Use the components directly in your JSX: | ||
```html | ||
// Example usage: | ||
<flex-box jc="space-between"> | ||
<flex-cell>Item 1</flex-cell> | ||
<flex-cell>Item 2</flex-cell> | ||
<span>1</span> | ||
<span>2</span> | ||
</flex-box> | ||
``` | ||
3. **Important**: This library uses Shadow DOM and is purely client-side, meaning it will only work on the client side. You can write syntax similar to regular HTML, but rendering will be handled exclusively on the client. | ||
4. Ensure the library is imported on the client side. If you're using `"use client"`, Next.js will handle the import correctly. However, if you're working with a server component, it won't render! You must ensure the script is loaded on the client side, either using lazy loading methods provided by Next.js or by utilizing `Script` from `next/script` to load the library as a polyfill for web component support on the client. | ||
```js | ||
import Script from "next/script"; | ||
export default function MyComponent() { | ||
return ( | ||
<> | ||
<Script src="https://unpkg.com/flex-layout-system/dist/browser.min.js" strategy="lazyOnload" /> | ||
<flex-box jc="space-between"> | ||
<span>1</span> | ||
<span>2</span> | ||
</flex-box> | ||
</> | ||
); | ||
} | ||
``` | ||
## Using Flex Layout System in Angular | ||
@@ -108,1 +132,11 @@ | ||
For more information and examples, visit the [official website](https://flexlayout.com). | ||
## Developer | ||
[](https://unbywyd.com) | ||
[](https://aiweb.co.il) | ||
This project was developed by **unbywyd**. | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
223299
0.66%140
32.08%0
-100%